Panel Interface Board  1
inszt_statusst.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:26:55 2020
5 */
6 /**************************************************************************************/
22 /**************************************************************************************/
23 /**************************************************************************************/
24 /**************************************************************************************/
25 /* Section: Included Files */
26 /**************************************************************************************/
27 /**************************************************************************************/
28 #define QQQdialect MPLABX
29 #undef QQQ146
30 #undef QQQ148
31 #undef QQQbndchk
32 #undef QQQ294
33 #undef QQQEMBEDDEDICE
34  /* Note: for BITMAP execution histories QQQthreaded is not defined */
35 #undef QQQthreaded
36 #undef QQQdo178b
37 #undef QQQfixbra
38 #define QQQswitch3
39 #undef QQQternary
40 #undef QQQswitch
41 #undef QQQmacrof
42 #undef QQQMULTIPROCESSEXH
43 #undef QQFLUSH
44 #undef QQNEWBS
45 #define qqqMaxBranchDepth 20
46 #define QQQstructbitmap
47  static int qqqqbmselwidth = 32 ;
48  static int zzfileid = 58;
49 #define QQQnumfil 23
50 #undef QQQALGONE
51 #undef QQQVCLFLG
52 #undef QQQFORKFL
53 #undef QQQIADDRF
54 #undef QQQRTI
55 #undef QQQPERFA
56 #undef QQQADRMOD
57 #undef QQQDCAPFL
58 #undef QQQTEMPLATEONLY
59 #define QQQNOATEXIT
60 #define QQQUPLOADATEND
61 #define QQQNOSTDIO
62 #undef QQQASHLINGVITRA
63 #define QQQBITMAP
64  #define qqqbitmapint unsigned int
65 #undef QQQBITMAPMCDC
66 #undef QQQTIC2XSERIALIO
67 #undef QQQTIC2XFLASH
68 #undef QQQCOMPRESSED_EXH
69 #undef QQQMAINFL
70 #define QQQSINGLEFILE
71 #define QQQFILEID
72 #define QQQseparate
73 extern int QQQindicator;
74 static int QQQfirstmcdc=1;
75 #define statusst_58zzopen zzopen
76  extern int statusst_58zzopen ;
77 #define statusst_58zqqzqz1 zqqzqz1
78 #define QQQLDRA_PORT
79 #ifndef QQQLDRA_PORT
80 #define FILEPOINT FILE * f,
81 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
82 #include <stdio.h>
83  /* ----------------------------------------------------------------------* 100 *
84  * If stdio.h is not available then insert:
85  * typedef int * FILE;
86  * -----------------------------------------------------------------------------
87  */
88 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
89 #else /* QQQLDRA_PORT */
90 #define FILEPOINT
91 /*************************** LDRA_PORT *********************************/
92 #ifdef QQQ_SHLAYOUT
93 static int tbrun_mode=1;
94 #else
95 static int tbrun_mode=0;
96 #endif /* QQQ_SHLAYOUT */
97 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
98 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
99 #ifndef QQQ_SHLAYOUT
100 #ifdef QQQMAINFL
101 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
102 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
103 #endif /* QQQMAINFL */
104 #endif /* QQQ_SHLAYOUT */
105 /************************ END OF LDRA_PORT *****************************/
106 #endif /* QQQLDRA_PORT */
107 #ifndef QQQnumfil
108 #define QQQnumfil 40 /* default setting */
109 #endif /* QQQnumfil */
110 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
111 #ifndef LDRA_VOID_FUNC
112 #define LDRA_VOID_FUNC
113  typedef void(*ldra_void_function)();
114 #endif
115 #if defined(QQQMAINFL)
116  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
117  through the target you would have to set this to 0 before calling the qqqupload.
118  Move this into ldra_port mechanism. */
119  int qqqshell_upload = 0;
120  int QQQfcn_ptr_num = 0;
121  static int qqqisinitialised = 0;
124  void qqqtotalupload(void);
125  void qqqtotalreset(void);
127  qqqaccumupload[x]=y;
128  qqqaccumreset[x]=z;
129  QQQfcn_ptr_num++;
130  }
131 #else /* (QQQMAINFL) */
132  extern int QQQfcn_ptr_num;
135  static int qqqstructzzopen = 0;
136 #endif /* defined(QQQMAINFL) */
137 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
138 #ifdef QQQ_KEEPCOMMENTS
139  /* -----------------------------------------------------------------------* 101 *
140  * Special settings for systems lacking standard functions.
141  * To include code for fprintf define ldra_fprintf
142  * To include code for sscanf define ldra_sscanf
143  * -----------------------------------------------------------------------------
144  */
145 #endif /* QQQ_KEEPCOMMENTS */
146 #if !defined(QQQSUPPRESS_UNDEF)
147 #undef ldra_fprintf
148 #undef ldra_sscanf
149 #endif /* !defined(QQQSUPPRESS_UNDEF) */
150  /* #define ldra_fprintf */
151  /* #define ldra_sscanf */
152 #undef QQQHITMAP_STORAGE
153 #undef qqnull_params
154 #define qqnull_params void
155 #define QQQ_PROTOTYPE_DEF
156  /* Conventional Instrumentation */
157 #undef QQ_ANSI_PROTOTYPE
158 #ifdef __STDC__
159 #define QQ_ANSI_PROTOTYPE 1
160 #else /* __STDC__ */
161 #ifdef VAXC
162 #define QQ_ANSI_PROTOTYPE 1
163 #endif /* VAXC */
164 #endif /* __STDC__ */
165  static unsigned char qqqzzglobflag = 0;
166  static struct bitmapstruct_t
167  {
168 #define ELEMENT(N) qqqbitmapint element##N;
169 #define LASTELEMENT
170 #include "statusst_58zbelem.def"
171 #undef ELEMENT
172 #undef LASTELEMENT
173  } bitmapstruct = {
174 #define ELEMENT(N) 0,
175 #undef LASTELEMENT
176 #include "statusst_58zbelem.def"
177 #undef ELEMENT
178  0};
179  static void qqoutput(FILEPOINT char * s,int i);
180  static void qqoutput2(FILEPOINT char * s,int i, int j);
181  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
182  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
183  static void qqoutput0(FILEPOINT char * s);
184  static int statusst_58zqqzqz(qqnull_params);
185  static int statusst_58zqqzqz1(qqnull_params);
186  static int statusst_58zqendz (int qqqi);
187  static int statusst_58zqzqzq (int qqqi);
188  static void qqqupload(qqnull_params);
189  static void qqqbitmapreset(qqnull_params);
190 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
191 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
192 /**************************************************************************************/
209 /**************************************************************************************/
210 #ifndef STATUSST_H /* Guard against multiple inclusion */
211 #define STATUSST_H
212 /**************************************************************************************/
213 /**************************************************************************************/
214 /* Section: Included Files */
215 /**************************************************************************************/
216 /**************************************************************************************/
217 #include <stdbool.h>
218 #include <stdint.h>
219 /*typedef unsigned char uchar8_t*/
220 /**************************************************************************************/
221 /**************************************************************************************/
222 /* Section: Interface Functions */
223 /**************************************************************************************/
224 /**************************************************************************************/
225 /*!*************************************************************************************
226  Function:
227  void Set_Status(uint8_t bitposn)
228  Summary:
229  This function sets the desired bit to a one in the PIB status register.
230  Description:
231  This function sets the desired bit to a one in the PIB status register. This is
232  called by various functions to indicate a command result or switch setting.
233 
234  Precondition:
235  None.
236  Parameters:
237  uint8_t bitposn - the desired bit position in the PIB status register.
238  Returns
239  None.
240 
241  Remarks:
242  None.
243 
244  Example:
245  Set_Status(6)
246  */
247 
248 void
249  Set_Status (
250  uint8_t bitposn ) ;
251 /*!*************************************************************************************
252  Function:
253  void Clear_Status(unsigned short bitposn)
254  Summary:
255  This function sets the desired bit to a zero in the PIB status register.
256  Description:
257  This function sets the desired bit to a zero in the PIB status register. This is
258  called by various functions to indicate a command result or switch setting.
259 
260  Precondition:
261  None.
262  Parameters:
263  uint8_t bitposn - the desired bit position in the PIB status register.
264  Returns
265  None.
266 
267  Remarks:
268  None.
269 
270  Example:
271  ClearStatus(7)
272  */
273 
274 void
275  Clear_Status (
276  uint8_t bitposn ) ;
277 /*!*************************************************************************************
278  Function:
279  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
280  Summary:
281  Function to prepare the protocol A response.
282  Description:
283  Function to prepare the protocol A response. The return message is seven bytes.
284  the first byte is the command that was sent. the next two bytes are the PIB status
285  register. The next three bytes can contain two - 12 bit data fields. The data is
286  then transferred to the TxFifo. The CRC for the return message is calculated
287  and placed in the last byte.
288 
289  Precondition:
290  None.
291  Parameters:
292  uint8_t byte - The command byte.
293  uint16_t data2 - a 12 bit data field.
294  uint16_t data1 - 1 12 bit data field.
295  Returns
296  None.
297 
298  Remarks:
299  None.
300 
301  Example:
302  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
303  */
304 
305 void
307  uint8_t byte ,
308  uint16_t data2 ,
309  uint16_t data1 ) ;
310 /*!*************************************************************************************
311  Function:
312  void Prepare_Return_B(uint8_t byt[] )
313  Summary:
314  Function to prepare the protocol B response.
315  Description:
316  Function to prepare the protocol B response. The return message is seven bytes.
317  the first byte is the command that was sent. the next two bytes are the PIB status
318  register. The next three bytes can contain a 12 bit Switch status register,
319  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
320  TxFifo. The CRC for the return message is calculated and placed in the last byte.
321 
322  Precondition:
323  None.
324  Parameters:
325  uint8_t byt[] - Three received bytes from a PerfSwitch.
326  Returns
327  None.
328 
329  Remarks:
330  None.
331 
332  Example:
333  Prepare_Return_B( MAN.msg )
334  */
335 
336 void
338  uint8_t byt [] ) ;
339  /* STATUSST_H */
340 /***************************************************************************************
341  End of File
342  */
343 
344 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
345 /* CLOSE_FILE Include File */
346 
347 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h */
348 /**************************************************************************************/
362 /**************************************************************************************/
363 #ifndef CRC_H /* Guard against multiple inclusion.*/
364 #define CRC_H
365 /**************************************************************************************/
366 /* ************************************************************************************/
367 /* Section: Included Files */
368 /**************************************************************************************/
369 /**************************************************************************************/
370 #include <stdint.h>
371 
372 typedef
373 unsigned char
375 /**************************************************************************************/
376 /**************************************************************************************/
377 /* Interface Functions */
378 /**************************************************************************************/
379 /**************************************************************************************/
380 /*!*************************************************************************************
381  Function:
382  void Calc_CRC(uint16_t nbits, uint8_t thebits)
383  Summary:
384  Function to calculate the CRC for a number of data bits.
385  Description:
386  Function to calculate the CRC for a number of data bits. The algorithm for the
387  CRC calculation was created by Tom Woods. CRCVal is usually reset to 0xFF prior
388  to calling this function. This is not the case when calculating the CRC for an
389  array.
390 
391  Precondition:
392  None.
393  Parameters:
394  int16_t nbits - the number of data bits.
395  uint8_t thebits - the data bits themselves.
396  Returns
397  None.
398 
399  Remarks
400  None.
401 
402  Example:
403  Calc_CRC( 8, Bytes[ 1 ] )
404  */
405 
406 void
407  Calc_CRC (
408  uint16_t nbits ,
409  uint8_t thebits ) ;
410 /*!*************************************************************************************
411  Function:
412  uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes[ ] )
413  Summary:
414  Function to calculate the CRC of an array of bytes. This function uses the function
415  CalcCRC to complete this task.
416  Description:
417  Function to calculate the CRC of an array of bytes. This function uses the function
418  CalcCRC to complete this task. It returns the eight bit CRCVal from the
419  calculation.
420 
421  Precondition:
422  None.
423  Parameters:
424  None.
425  Returns
426  uint8_t CRCVal
427 
428  Remarks
429  None.
430 
431  Example:
432  a_comm_crc = CalcCRCArray( 6, a_temp )
433  */
434 
435 uint8_t
437  uint16_t Count ,
438  const uint8_t Bytes [] ) ;
439 /*!*************************************************************************************
440  Function:
441  uint8_t Calc_CRC_Uplink(int16_t Count, const uint8_t Bytes[ ] )
442  Summary:
443  Function to calculate the CRC from a received PerfSwitch message.
444  Description:
445  Function to calculate the CRC from a received PerfSwitch message. This function
446  makes use of the function CalcCRC() to perform the calculation. The CRC result
447  is compared to the third byte of the returned Manchester message.
448 
449 
450 
451  Precondition:
452  None.
453  Parameters:
454  int16_t Count: Acts as a flag.
455  unsigned char Bytes[ ]:
456  Returns:
457  uint8_t CRCVal
458 
459  Remarks:
460  None.
461 
462  Example:
463  crcans1 = Calc_CRC_Uplink( 3, MAN.MSG )
464  */
465 
466 uint8_t
468  uint16_t Count ,
469  const uint8_t Bytes [] ) ;
470 /*!*************************************************************************************
471  Function:
472  void Reset_CRC_Value( void )
473  Summary:
474  This function resets the CRC value so a new calculation can take place.
475  Description:
476  This function resets the CRC value so a new calculation can take place. It
477  resets the value to 0xFF. This allows for the proper bit manipulation during
478  the CRC calculation.
479 
480  Precondition:
481  None.
482  Parameters:
483  None.
484  Returns
485  None.
486 
487  Remarks
488  None.
489 
490  Example:
491  Reset_CRC_Value()
492  */
493 
494 void
495  Reset_CRC_Value ( void ) ;
496 /*!*************************************************************************************
497  Function:
498  uint8_t GetCRCValue( void ))
499  Summary:
500  Function to return a previously calculated CRC value.
501  Description:
502  Function to return a previously calculated CRC value. No calculations are done
503  here.
504 
505  Precondition:
506  None.
507  Parameters:
508  None.
509  Returns
510  uint8_t CRCVal
511 
512  Remarks
513  None.
514 
515  Example:
516  FSK.crc = Get_CRC_Value( )
517  */
518 
519 uint8_t
520  Get_CRC_Value ( void ) ;
521  /* CRC_H */
522 /***************************************************************************************
523  End of File
524  */
525 
526 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h*/
527 /* CLOSE_FILE Include File */
528 
529 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h */
530 /**************************************************************************************/
544 /**************************************************************************************/
545 #ifndef FIFO_H /* Guard against multiple inclusion */
546 #define FIFO_H
547 /**************************************************************************************/
548 /**************************************************************************************/
549 /* Section: Included Files */
550 /**************************************************************************************/
551 /**************************************************************************************/
552 #include <stdbool.h>
553 #include <stdint.h>
554 /**************************************************************************************/
555 /**************************************************************************************/
556 /* Section: Defines */
557 /**************************************************************************************/
558 /**************************************************************************************/
559 #define FIFO_RX_SIZE 7
560 #define FIFO_TX_SIZE 7
561  /* FifoPut Return values.*/
562 #define FIFO_ADD_OK 0
563 #define FIFO_FULL 1
564  /* FifoGet Return Value.*/
565 #define FIFO_EMPTY 2U
566 /**************************************************************************************/
567 /**************************************************************************************/
568 /* Section: Data Types */
569 /**************************************************************************************/
570 /**************************************************************************************/
571 
572 typedef
573  struct
574  {
575  uint8_t length ;
576  uint8_t * ptr_buffer ;
578  /* Filled in by the FIFO functions.*/
579  uint8_t head ;
580  uint8_t tail ;
581  uint8_t num_records ;
582  uint8_t put_error ;
583  uint8_t get_error ;
584  bool fEmpty ;
585  bool fFull ;
586  } TFifo ;
587 
588 extern TFifo
589  RX_FIFO ; /* This structure is used for both the RxFifo and TxFifo.*/
590 
591 extern TFifo
592  TX_FIFO ;
593 /**************************************************************************************/
594 /**************************************************************************************/
595 /* Section: Local Functions */
596 /**************************************************************************************/
597 /**************************************************************************************/
598 /*!*************************************************************************************
599  Function:
600  static void Fifo_Init( TFifo *ptrFifo, unsigned char *ptrBuffer, int Length )
601  Summary:
602  This function initializes a given Fifo.
603  Description:
604  This function initializes the communication Fifo. It is used to initialize both
605  the transmit and receive Fifo's.
606 
607  Precondition:
608  None.
609  Parameters:
610  None.
611  Returns
612  None.
613 
614  Remarks:
615  None.
616 
617  Example:
618  Fifo_Init( &RX_FIFO, FifoRxBuffer, FIFO_RX_SIZE )
619  */
620 
621 static void
622  Fifo_Init (
623  TFifo * ptrFifo ,
624  uint8_t * ptrBuffer ,
625  uint16_t Length ) ;
626 /**************************************************************************************/
627 /**************************************************************************************/
628 /* Section: Interface Functions */
629 /**************************************************************************************/
630 /**************************************************************************************/
631 /*!*************************************************************************************
632  Function:
633  void Init_Fifo(void)
634  Summary:
635  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
636  Description:
637  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
638  This function is called in APP_Initialize in app.c
639 
640 
641  Precondition:
642  None.
643  Parameters:
644  None.
645  Returns
646  None.
647 
648  Remarks:
649  None.
650 
651  Example:
652  Init_Fifo()
653  */
654 
655 void
656  Init_Fifo ( void ) ;
657 /*!*************************************************************************************
658  Function:
659  uint8_t Fifo_Put( TFifo *ptrFifo, uint8_t Data )
660  Summary:
661  Function to add an entry (byte)to a Fifo.
662  Description:
663  Function to add an entry (byte)to a Fifo. If the Fifo is full then the function
664  returns FIFO_FULL, otherwise the function adds the entry to the FifoBuffer,
665  increments FifoHead and returns FIFO_ADD_OK.
666 
667  Precondition:
668  None.
669  Parameters:
670  uint8_t Data: The byte of data to be added.
671  TFifo *ptrFifo: The pointer to the Fifo that is being manipulated.
672  Returns
673  integer value. Fifo_Full or FIFO_ADD_OK
674 
675  Remarks:
676  None.
677 
678  Example:
679  Fifo_Put( &TX_FIFO, b_comm_crc )
680  */
681 
682 uint8_t
683  Fifo_Put (
684  TFifo * ptrFifo ,
685  uint8_t Data ) ;
686 /*!*************************************************************************************
687  Function:
688  uint8_t Fifo_Get( TFifo *ptrFifo )
689  Summary:
690  Function to retrieve an entry from Fifo.
691  Description:
692  Function to retrieve an entry from Fifo. If Fifo is empty then function returns
693  FIFO_EMPTY. Otherwise, the function returns the oldest entry in FifoBuffer and
694  increments FifoTail.
695 
696  Precondition:
697  None.
698  Parameters:
699  TFifo *ptrFifo
700  Returns
701  uint8_t Contents of Fifo buffer.
702 
703  Remarks:
704  None.
705 
706  Example:
707  temp = Fifo_Get( &RX_FIFO )
708  */
709 
710 uint8_t
711  Fifo_Get (
712  TFifo * ptrFifo ) ;
713 /*!*************************************************************************************
714  Function:
715  uint8_t Fifo_Length( TFifo *ptrFifo )
716  Summary:
717  Function to find the length of the buffer.
718  Description:
719  Function to find the length of the buffer.
720 
721  Precondition:
722  None.
723  Parameters:
724  TFifo *ptrFifo: The pointer to the Fifo.
725  Returns
726  uint8_t. Length of the fifo buffer.
727 
728  Remarks:
729  None.
730 
731  Example:
732  if( Fifo_Length( &RX_FIFO ) == CMD.cmd_size )
733  */
734 
735 uint8_t
736  Fifo_Length (
737  TFifo * ptrFifo ) ;
738  /* FIFO_H */
739 /***************************************************************************************
740  End of File
741  */
742 
743 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h*/
744 /* CLOSE_FILE Include File */
745 
746 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h */
747 /**************************************************************************************/
761 /**************************************************************************************/
762 #ifndef FSK_H /* Guard against multiple inclusion */
763 #define FSK_H
764 /**************************************************************************************/
765 /**************************************************************************************/
766 /* Section: Included Files */
767 /**************************************************************************************/
768 /**************************************************************************************/
769 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
770 /*******************************************************************************
771  MPLAB Harmony System Configuration Header
772  File Name:
773  system_config.h
774  Summary:
775  Build-time configuration header for the system defined by this MPLAB Harmony
776  project.
777  Description:
778  An MPLAB Project may have multiple configurations. This file defines the
779  build-time options for a single configuration.
780  Remarks:
781  This configuration header must not define any prototypes or data
782  definitions (or include any files that do). It only provides macro
783  definitions for build-time configuration options that are not instantiated
784  until used by another MPLAB Harmony module or application.
785  Created with MPLAB Harmony Version 2.06
786 *******************************************************************************/
787 // DOM-IGNORE-BEGIN
788 /*******************************************************************************
789 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
790 Microchip licenses to you the right to use, modify, copy and distribute
791 Software only when embedded on a Microchip microcontroller or digital signal
792 controller that is integrated into your product or third party product
793 (pursuant to the sublicense terms in the accompanying license agreement).
794 You should refer to the license agreement accompanying this Software for
795 additional information regarding your rights and obligations.
796 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
797 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
798 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
799 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
800 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
801 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
802 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
803 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
804 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
805 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
806 *******************************************************************************/
807 // DOM-IGNORE-END
808 #ifndef _SYSTEM_CONFIG_H
809 #define _SYSTEM_CONFIG_H
810 // *****************************************************************************
811 // *****************************************************************************
812 // Section: Included Files
813 // *****************************************************************************
814 // *****************************************************************************
815 /* This section Includes other configuration headers necessary to completely
816  define this configuration.
817 */
818 // DOM-IGNORE-BEGIN
819 // DOM-IGNORE-END
820 // *****************************************************************************
821 // *****************************************************************************
822 // Section: System Service Configuration
823 // *****************************************************************************
824 // *****************************************************************************
825 // *****************************************************************************
826 /* Common System Service Configuration Options
827 */
828 #define SYS_VERSION_STR "2.06"
829 #define SYS_VERSION 20600
830 // *****************************************************************************
831 /* Clock System Service Configuration Options
832 */
833 #define SYS_CLK_FREQ 200000000ul
834 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
835 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
836 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
837 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
838 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
839 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
840 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
841 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
842 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
843 /*** Ports System Service Configuration ***/
844 #define SYS_PORT_A_ANSEL 0x3F00
845 #define SYS_PORT_A_TRIS 0xFFED
846 #define SYS_PORT_A_LAT 0x0010
847 #define SYS_PORT_A_ODC 0x0000
848 #define SYS_PORT_A_CNPU 0x0020
849 #define SYS_PORT_A_CNPD 0x0000
850 #define SYS_PORT_A_CNEN 0x0021
851 #define SYS_PORT_B_ANSEL 0x10C8
852 #define SYS_PORT_B_TRIS 0x91FF
853 #define SYS_PORT_B_LAT 0x0000
854 #define SYS_PORT_B_ODC 0x0000
855 #define SYS_PORT_B_CNPU 0x0000
856 #define SYS_PORT_B_CNPD 0x0000
857 #define SYS_PORT_B_CNEN 0x0000
858 #define SYS_PORT_C_ANSEL 0xCFE1
859 #define SYS_PORT_C_TRIS 0xFFFF
860 #define SYS_PORT_C_LAT 0x0000
861 #define SYS_PORT_C_ODC 0x0000
862 #define SYS_PORT_C_CNPU 0x0000
863 #define SYS_PORT_C_CNPD 0x0000
864 #define SYS_PORT_C_CNEN 0x0000
865 #define SYS_PORT_D_ANSEL 0xC100
866 #define SYS_PORT_D_TRIS 0xFFFF
867 #define SYS_PORT_D_LAT 0x0000
868 #define SYS_PORT_D_ODC 0x0000
869 #define SYS_PORT_D_CNPU 0x0000
870 #define SYS_PORT_D_CNPD 0x0000
871 #define SYS_PORT_D_CNEN 0x0000
872 #define SYS_PORT_E_ANSEL 0xFC00
873 #define SYS_PORT_E_TRIS 0xFDFF
874 #define SYS_PORT_E_LAT 0x0000
875 #define SYS_PORT_E_ODC 0x0000
876 #define SYS_PORT_E_CNPU 0x0000
877 #define SYS_PORT_E_CNPD 0x0000
878 #define SYS_PORT_E_CNEN 0x0000
879 #define SYS_PORT_F_ANSEL 0xCEC0
880 #define SYS_PORT_F_TRIS 0xEFFF
881 #define SYS_PORT_F_LAT 0x0000
882 #define SYS_PORT_F_ODC 0x0000
883 #define SYS_PORT_F_CNPU 0x0000
884 #define SYS_PORT_F_CNPD 0x0000
885 #define SYS_PORT_F_CNEN 0x0000
886 #define SYS_PORT_G_ANSEL 0x8CBC
887 #define SYS_PORT_G_TRIS 0xDFFF
888 #define SYS_PORT_G_LAT 0x0000
889 #define SYS_PORT_G_ODC 0x0000
890 #define SYS_PORT_G_CNPU 0x0000
891 #define SYS_PORT_G_CNPD 0x0000
892 #define SYS_PORT_G_CNEN 0x0000
893 #define SYS_PORT_H_ANSEL 0x0070
894 #define SYS_PORT_H_TRIS 0xB3FB
895 #define SYS_PORT_H_LAT 0x0000
896 #define SYS_PORT_H_ODC 0x0000
897 #define SYS_PORT_H_CNPU 0x0000
898 #define SYS_PORT_H_CNPD 0x0000
899 #define SYS_PORT_H_CNEN 0x0000
900 #define SYS_PORT_J_ANSEL 0x0000
901 #define SYS_PORT_J_TRIS 0x8B7F
902 #define SYS_PORT_J_LAT 0x0080
903 #define SYS_PORT_J_ODC 0x0000
904 #define SYS_PORT_J_CNPU 0x0000
905 #define SYS_PORT_J_CNPD 0x0000
906 #define SYS_PORT_J_CNEN 0x0800
907 #define SYS_PORT_K_ANSEL 0xFF00
908 #define SYS_PORT_K_TRIS 0xFFFF
909 #define SYS_PORT_K_LAT 0x0000
910 #define SYS_PORT_K_ODC 0x0000
911 #define SYS_PORT_K_CNPU 0x0000
912 #define SYS_PORT_K_CNPD 0x0000
913 #define SYS_PORT_K_CNEN 0x0000
914 /*** Interrupt System Service Configuration ***/
915 #define SYS_INT true
916 /*** Timer System Service Configuration ***/
917 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
918 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
919 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
920 #define SYS_TMR_FREQUENCY 1000
921 #define SYS_TMR_FREQUENCY_TOLERANCE 10
922 #define SYS_TMR_UNIT_RESOLUTION 10000
923 #define SYS_TMR_CLIENT_TOLERANCE 10
924 #define SYS_TMR_INTERRUPT_NOTIFICATION false
925 // *****************************************************************************
926 // *****************************************************************************
927 // Section: Driver Configuration
928 // *****************************************************************************
929 // *****************************************************************************
930 #define DRV_IC_DRIVER_MODE_STATIC
931 #define USE_8BIT_PMP
932 /*** SPI Driver Configuration ***/
933 #define DRV_SPI_NUMBER_OF_MODULES 6
934 /*** Driver Compilation and static configuration options. ***/
935 /*** Select SPI compilation units.***/
936 #define DRV_SPI_POLLED 1
937 #define DRV_SPI_ISR 0
938 #define DRV_SPI_MASTER 1
939 #define DRV_SPI_SLAVE 0
940 #define DRV_SPI_RM 0
941 #define DRV_SPI_EBM 1
942 #define DRV_SPI_8BIT 1
943 #define DRV_SPI_16BIT 1
944 #define DRV_SPI_32BIT 0
945 #define DRV_SPI_DMA 0
946 /*** SPI Driver Static Allocation Options ***/
947 #define DRV_SPI_INSTANCES_NUMBER 3
948 #define DRV_SPI_CLIENTS_NUMBER 3
949 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
950 /* SPI Driver Instance 0 Configuration */
951 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
952 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
953 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
954 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
955 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
956 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
957 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
958 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
959 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
960 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
961 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
962 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
963 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
964 #define DRV_SPI_BAUD_RATE_IDX0 1000000
965 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
966 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
967 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
968 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
969 #define DRV_SPI_QUEUE_SIZE_IDX0 10
970 #define DRV_SPI_RESERVED_JOB_IDX0 1
971 /* SPI Driver Instance 1 Configuration */
972 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
973 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
974 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
975 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
976 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
977 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
978 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
979 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
980 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
981 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
982 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
983 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
984 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
985 #define DRV_SPI_BAUD_RATE_IDX1 1000000
986 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
987 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
988 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
989 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
990 #define DRV_SPI_QUEUE_SIZE_IDX1 10
991 #define DRV_SPI_RESERVED_JOB_IDX1 1
992 /* SPI Driver Instance 2 Configuration */
993 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
994 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
995 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
996 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
997 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
998 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
999 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
1000 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
1001 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
1002 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
1003 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
1004 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
1005 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
1006 #define DRV_SPI_BAUD_RATE_IDX2 500000
1007 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
1008 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
1009 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
1010 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
1011 #define DRV_SPI_QUEUE_SIZE_IDX2 10
1012 #define DRV_SPI_RESERVED_JOB_IDX2 1
1013 /*** Timer Driver Configuration ***/
1014 #define DRV_TMR_INTERRUPT_MODE true
1015 /*** Timer Driver 0 Configuration ***/
1016 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
1017 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
1018 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
1019 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
1020 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
1021 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
1022 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
1023 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
1024 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
1025 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
1026 #define DRV_TMR_POWER_STATE_IDX0
1027 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
1028 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
1029 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
1030 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
1031 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
1032 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
1033 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
1034 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
1035 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
1036 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
1037 #define DRV_TMR_POWER_STATE_IDX1
1038 /*** Timer Driver 2 Configuration ***/
1039 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
1040 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
1041 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
1042 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
1043 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
1044 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
1045 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
1046 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
1047 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
1048 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
1049 #define DRV_TMR_POWER_STATE_IDX2
1050 /*** Timer Driver 3 Configuration ***/
1051 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
1052 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
1053 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
1054 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
1055 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
1056 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
1057 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
1058 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
1059 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
1060 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
1061 #define DRV_TMR_POWER_STATE_IDX3
1062 /*** Timer Driver 4 Configuration ***/
1063 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
1064 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
1065 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
1066 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
1067 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
1068 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
1069 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
1070 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
1071 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
1072 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
1073 #define DRV_TMR_POWER_STATE_IDX4
1074  // *****************************************************************************
1075 /* USART Driver Configuration Options
1076 */
1077 #define DRV_USART_INSTANCES_NUMBER 1
1078 #define DRV_USART_CLIENTS_NUMBER 1
1079 #define DRV_USART_INTERRUPT_MODE false
1080 #define DRV_USART_BYTE_MODEL_SUPPORT true
1081 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
1082 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
1083 // *****************************************************************************
1084 // *****************************************************************************
1085 // Section: Middleware & Other Library Configuration
1086 // *****************************************************************************
1087 // *****************************************************************************
1088 /*** USB Driver Configuration ***/
1089 /* Enables Device Support */
1090 #define DRV_USBHS_DEVICE_SUPPORT true
1091 /* Disable Host Support */
1092 #define DRV_USBHS_HOST_SUPPORT false
1093 /* Maximum USB driver instances */
1094 #define DRV_USBHS_INSTANCES_NUMBER 1
1095 /* Interrupt mode enabled */
1096 #define DRV_USBHS_INTERRUPT_MODE true
1097 /* Number of Endpoints used */
1098 #define DRV_USBHS_ENDPOINTS_NUMBER 2
1099 /*** USB Device Stack Configuration ***/
1100 /* The USB Device Layer will not initialize the USB Driver */
1101 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
1102 /* Maximum device layer instances */
1103 #define USB_DEVICE_INSTANCES_NUMBER 1
1104 /* EP0 size in bytes */
1105 #define USB_DEVICE_EP0_BUFFER_SIZE 64
1106 /* Endpoint Transfer Queue Size combined for Read and write */
1107 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
1108 // *****************************************************************************
1109 // *****************************************************************************
1110 // Section: Application Configuration
1111 // *****************************************************************************
1112 // *****************************************************************************
1113 /*** Application Defined Pins ***/
1114 /*** Functions for LED1 pin ***/
1115 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1116 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1117 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1118 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1119 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
1120 /*** Functions for LED2 pin ***/
1121 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1122 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1123 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1124 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1125 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
1126 /*** Functions for DMP_FIRE_LED pin ***/
1127 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1128 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1129 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1130 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1131 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
1132 /*** Functions for HVPS_ENB pin ***/
1133 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1134 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1135 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1136 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1137 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
1138 /*** Functions for RLY_HVPS_OUT pin ***/
1139 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1140 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1141 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1142 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1143 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
1144 /*** Functions for RLY_WL_SPS_POL pin ***/
1145 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1146 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1147 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1148 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1149 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
1150 /*** Functions for RLY_LOG pin ***/
1151 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1152 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1153 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1154 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1155 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
1156 /*** Functions for RLY_DMP_FIRE pin ***/
1157 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1158 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1159 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1160 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1161 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
1162 /*** Functions for RLY_AUX pin ***/
1163 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1164 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1165 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1166 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1167 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
1168 /*** Functions for RLY_CCL pin ***/
1169 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1170 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1171 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1172 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1173 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
1174 /*** Functions for RLY_WL_MON pin ***/
1175 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1176 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1177 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1178 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1179 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
1180 /*** Functions for RLY_ARMCF pin ***/
1181 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1182 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1183 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1184 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1185 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
1186 /*** Functions for RLY_ARM pin ***/
1187 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1188 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1189 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1190 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1191 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
1192 /*** Functions for TPAN1 pin ***/
1193 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1194 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1195 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1196 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1197 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
1198 /*** Functions for TPAN2 pin ***/
1199 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1200 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1201 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1202 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1203 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
1204 /*** Functions for FSK_DAC_CS pin ***/
1205 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1206 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1207 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1208 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1209 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
1210 /*** Functions for RLY_COMM pin ***/
1211 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1212 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1213 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1214 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1215 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
1216 /*** Functions for FSK_DAC_CLR pin ***/
1217 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1218 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1219 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1220 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1221 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
1222 /*** Functions for WL_CPS_SW pin ***/
1223 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1224 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1225 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1226 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1227 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
1228 /*** Functions for HVPS_SW pin ***/
1229 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
1230 /*** Functions for MAN_SIG pin ***/
1231 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
1232 /*** Functions for DMP_FIRE_SW pin ***/
1233 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
1234 /*** Functions for NEG_SW pin ***/
1235 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
1236 /*** Functions for POS_SW pin ***/
1237 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
1238 /*** Functions for DRUM1_SW pin ***/
1239 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
1240 /*** Functions for SAFE_SW pin ***/
1241 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
1242 /*** Functions for DRUM2_SW pin ***/
1243 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
1244 /*** Functions for LOG_SW pin ***/
1245 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
1246 /*** Functions for AUX_SW pin ***/
1247 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
1248 /*** Functions for ARMCF_SW pin ***/
1249 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
1250 /*** Functions for ARM_SW pin ***/
1251 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
1252 /*** Functions for ARMCF_AUTO_SW pin ***/
1253 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
1254 /*** Functions for FIRE_SW_OFF pin ***/
1255 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
1256 /*** Functions for FIRE_SW_ON pin ***/
1257 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
1258 /*** Functions for WL_SPS_POS_DET pin ***/
1259 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
1260 /*** Functions for WL_SPS_NEG_DET pin ***/
1261 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
1262 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
1263 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
1264 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
1265 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
1266 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
1267 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
1268 /*** Application Instance 0 Configuration ***/
1269 //DOM-IGNORE-BEGIN
1270 //DOM-IGNORE-END
1271  // _SYSTEM_CONFIG_H
1272 /*******************************************************************************
1273  End of File
1274 */
1275 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
1276 /* CLOSE_FILE Include File */
1277 
1278 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
1279 /*******************************************************************************
1280  System Definitions
1281  File Name:
1282  system_definitions.h
1283  Summary:
1284  MPLAB Harmony project system definitions.
1285  Description:
1286  This file contains the system-wide prototypes and definitions for an MPLAB
1287  Harmony project.
1288  *******************************************************************************/
1289 //DOM-IGNORE-BEGIN
1290 /*******************************************************************************
1291 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1292 Microchip licenses to you the right to use, modify, copy and distribute
1293 Software only when embedded on a Microchip microcontroller or digital signal
1294 controller that is integrated into your product or third party product
1295 (pursuant to the sublicense terms in the accompanying license agreement).
1296 You should refer to the license agreement accompanying this Software for
1297 additional information regarding your rights and obligations.
1298 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1299 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1300 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1301 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1302 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1303 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1304 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1305 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1306 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1307 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1308  *******************************************************************************/
1309 //DOM-IGNORE-END
1310 #ifndef _SYS_DEFINITIONS_H
1311 #define _SYS_DEFINITIONS_H
1312 // *****************************************************************************
1313 // *****************************************************************************
1314 // Section: Included Files
1315 // *****************************************************************************
1316 // *****************************************************************************
1317 #include <stdint.h>
1318 #include <stddef.h>
1319 #include <stdbool.h>
1320 #include "system/common/sys_common.h"
1321 #include "system/common/sys_module.h"
1322 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
1323 /*******************************************************************************
1324  Input Capture Driver Interface Declarations for Static Single Instance Driver
1325  Company:
1326  Microchip Technology Inc.
1327  File Name:
1328  help_drv_ic.h
1329  Summary:
1330  Input Capture driver interface declarations for the static single instance
1331  driver.
1332  Description:
1333  The Input Capture device driver provides a simple interface to manage the
1334  Input Capture modules on Microchip microcontrollers. This file defines
1335  the interface declarations for the IC driver.
1336 
1337  Remarks:
1338  Static interfaces incorporate the driver instance number within the names
1339  of the routines, eliminating the need for an object ID or object handle.
1340 
1341  Static single-open interfaces also eliminate the need for the open handle.
1342 *******************************************************************************/
1343 //DOM-IGNORE-BEGIN
1344 /*******************************************************************************
1345 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
1346 Microchip licenses to you the right to use, modify, copy and distribute
1347 Software only when embedded on a Microchip microcontroller or digital signal
1348 controller that is integrated into your product or third party product
1349 (pursuant to the sublicense terms in the accompanying license agreement).
1350 You should refer to the license agreement accompanying this Software for
1351 additional information regarding your rights and obligations.
1352 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1353 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1354 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1355 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1356 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1357 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1358 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1359 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1360 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1361 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1362 *******************************************************************************/
1363 //DOM-IGNORE-END
1364 #ifndef _DRV_IC_H
1365 #define _DRV_IC_H
1366 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1367 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
1368 /*******************************************************************************
1369  Driver Common Header Definitions
1370  Company:
1371  Microchip Technology Inc.
1372  File Name:
1373  drv_common.h
1374  Summary:
1375  This file defines the common macros and definitions used by the driver
1376  definition and implementation headers.
1377  Description:
1378  This file defines the common macros and definitions used by the driver
1379  definition and the implementation header.
1380  Remarks:
1381  The directory in which this file resides should be added to the compiler's
1382  search path for header files.
1383  *******************************************************************************/
1384 //DOM-IGNORE-BEGIN
1385 /*******************************************************************************
1386 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
1387 Microchip licenses to you the right to use, modify, copy and distribute
1388 Software only when embedded on a Microchip microcontroller or digital signal
1389 controller that is integrated into your product or third party product
1390 (pursuant to the sublicense terms in the accompanying license agreement).
1391 You should refer to the license agreement accompanying this Software for
1392 additional information regarding your rights and obligations.
1393 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
1394 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1395 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1396 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1397 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1398 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1399 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1400 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1401 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1402 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1403  *******************************************************************************/
1404 //DOM-IGNORE-END
1405 #ifndef _DRV_COMMON_H
1406 #define _DRV_COMMON_H
1407 #include <stdint.h>
1408 #include <stddef.h>
1409 // *****************************************************************************
1410 /* Device Driver I/O Intent
1411  Summary:
1412  Identifies the intended usage of the device when it is opened.
1413  Description:
1414  This enumeration identifies the intended usage of the device when the
1415  caller opens the device. It identifies the desired behavior of the device
1416  driver for the following:
1417  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
1418  block until the operation is finished or do they return immediately and
1419  require the caller to call another routine to check the status of the
1420  operation)
1421  * Support reading and/or writing of data from/to the device
1422  * Identify the buffering behavior (sometimes called "double buffering" of
1423  the driver. Indicates if the driver should maintain its own read/write
1424  buffers and copy data to/from these buffers to/from the caller's buffers.
1425  * Identify the DMA behavior of the peripheral
1426  Remarks:
1427  The buffer allocation method is not identified by this enumeration. Buffers
1428  can be allocated statically at build time, dynamically at run-time, or
1429  even allocated by the caller and passed to the driver for its own usage if
1430  a driver-specific routine is provided for such. This choice is left to
1431  the design of the individual driver and is considered part of its
1432  interface.
1433  These values can be considered "flags". One selection from each of the
1434  groups below can be ORed together to create the complete value passed
1435  to the driver's open routine.
1436 */
1437 
1438 typedef
1439  enum
1440  {
1441  /* Read */
1442  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
1443  = 1 << 0 /* DOM-IGNORE-END*/
1444  ,
1445  /* Write */
1446  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
1447  = 1 << 1 /* DOM-IGNORE-END*/
1448  ,
1449  /* Read and Write*/
1450  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
1451  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
1452  ,
1453  /* The driver will block and will return when the operation is complete */
1454  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
1455  = 0 << 2 /* DOM-IGNORE-END*/
1456  ,
1457  /* The driver will return immediately */
1458  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
1459  = 1 << 2 /* DOM-IGNORE-END*/
1460  ,
1461  /* The driver will support only one client at a time */
1462  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
1463  = 1 << 3 /* DOM-IGNORE-END*/
1464  ,
1465  /* The driver will support multiple clients at a time */
1466  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
1467  = 0 << 3 /* DOM-IGNORE-END*/
1468  } DRV_IO_INTENT ;
1469 // *****************************************************************************
1470 /* Driver Client Status
1471  Summary:
1472  Identifies the current status/state of a client's connection to a driver.
1473  Description:
1474  This enumeration identifies the current status/state of a client's link to
1475  a driver.
1476  Remarks:
1477  The enumeration used as the return type for the client-level status routines
1478  defined by each device driver or system module (for example,
1479  DRV_USART_ClientStatus) must be based on the values in this enumeration.
1480 */
1481 
1482 typedef
1483  enum
1484  {
1485  /* Indicates that a driver-specific error has occurred. */
1487  /* An unspecified error has occurred.*/
1489  /* The driver is closed, no operations for this client are ongoing,
1490  and/or the given handle is invalid. */
1492  /* The driver is currently busy and cannot start additional operations. */
1494  /* The module is running and ready for additional operations */
1496  /* Indicates that the module is in a driver-specific ready/run state. */
1498  } DRV_CLIENT_STATUS ;
1499 // *****************************************************************************
1500 /* Device Driver Blocking Status Macro
1501  Summary:
1502  Returns if the I/O intent provided is blocking
1503  Description:
1504  This macro returns if the I/O intent provided is blocking.
1505  Remarks:
1506  None.
1507 */
1508 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
1509 // *****************************************************************************
1510 /* Device Driver Non Blocking Status Macro
1511  Summary:
1512  Returns if the I/O intent provided is non-blocking.
1513  Description:
1514  This macro returns if the I/ intent provided is non-blocking.
1515  Remarks:
1516  None.
1517 */
1518 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
1519 // *****************************************************************************
1520 /* Device Driver Exclusive Status Macro
1521  Summary:
1522  Returns if the I/O intent provided is non-blocking.
1523  Description:
1524  This macro returns if the I/O intent provided is non-blocking.
1525  Remarks:
1526  None.
1527 */
1528 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
1529 // *****************************************************************************
1530 /* Device Driver IO Buffer Identifier
1531  Summary:
1532  Identifies to which buffer a device operation will apply.
1533  Description:
1534  This enumeration identifies to which buffer (read, write, both, or neither)
1535  a device operation will apply. This is used for "flush" (or similar)
1536  operations.
1537 */
1538 
1539 typedef
1540  enum
1541  {
1542  // Operation does not apply to any buffer
1544  // Operation applies to read buffer
1546  // Operation applies to write buffer
1548  // Operation applies to both read and write buffers
1551 // *****************************************************************************
1552 /* Device Handle
1553  Summary:
1554  Handle to an opened device driver.
1555  Description:
1556  This handle identifies the open instance of a device driver. It must be
1557  passed to all other driver routines (except the initialization, deinitialization,
1558  or power routines) to identify the caller.
1559  Remarks:
1560  Every application or module that wants to use a driver must first call
1561  the driver's open routine. This is the only routine that is absolutely
1562  required for every driver.
1563  If a driver is unable to allow an additional module to use it, it must then
1564  return the special value DRV_HANDLE_INVALID. Callers should check the
1565  handle returned for this value to ensure this value was not returned before
1566  attempting to call any other driver routines using the handle.
1567 */
1568 
1569 typedef
1570 uintptr_t
1572 // *****************************************************************************
1573 /* Invalid Device Handle
1574  Summary:
1575  Invalid device handle.
1576  Description:
1577  If a driver is unable to allow an additional module to use it, it must then
1578  return the special value DRV_HANDLE_INVALID. Callers should check the
1579  handle returned for this value to ensure this value was not returned before
1580  attempting to call any other driver routines using the handle.
1581  Remarks:
1582  None.
1583 */
1584 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1585 // *****************************************************************************
1586 /* Not supported configuration
1587  Summary:
1588  Not supported configuration.
1589  Description:
1590  If the configuration option is not supported on an instance of the
1591  peripheral, use this macro to equate to that configuration. This option
1592  should be listed as a possible value in the description of that
1593  configuration option.
1594 */
1595 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1596 // *****************************************************************************
1597 /* Unsupported Attribute Abstraction
1598  Summary:
1599  Abstracts the use of the unsupported attribute defined by the compiler.
1600  Description:
1601  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1602  compilation of the drivers for all different variants.
1603  Example:
1604  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1605  This function will not generate a compiler error if the interface is not
1606  defined for the selected device.
1607  Remarks:
1608  None.
1609 */
1610 #define _PLIB_UNSUPPORTED
1611  //_DRV_COMMON_H
1612 /*******************************************************************************
1613  End of File
1614 */
1615 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1616 /* CLOSE_FILE Include File */
1617 
1618 #include "system/common/sys_module.h"
1619 // *****************************************************************************
1620 /* IC Driver Module Index Numbers
1621  Summary:
1622  IC driver index definitions.
1623  Description:
1624  These constants provide IC Driver index definitions.
1625  Remarks:
1626  These constants should be used in place of hard-coded numeric literals.
1627  These values should be passed into the DRV_IC_Initialize and
1628  DRV_IC_Open routines to identify the driver instance in use.
1629 */
1630 #define DRV_IC_INDEX_0 0
1631 #define DRV_IC_INDEX_1 1
1632 #define DRV_IC_INDEX_2 2
1633 #define DRV_IC_INDEX_3 3
1634 #define DRV_IC_INDEX_4 4
1635 #define DRV_IC_INDEX_5 5
1636 #define DRV_IC_INDEX_6 6
1637 #define DRV_IC_INDEX_7 7
1638 #define DRV_IC_INDEX_8 8
1639 #define DRV_IC_INDEX_9 9
1640 #define DRV_IC_INDEX_10 10
1641 #define DRV_IC_INDEX_11 11
1642 #define DRV_IC_INDEX_12 12
1643 #define DRV_IC_INDEX_13 13
1644 #define DRV_IC_INDEX_14 14
1645 #define DRV_IC_INDEX_15 15
1646 // *****************************************************************************
1647 // *****************************************************************************
1648 // Section: Interface Headers for the static driver
1649 // *****************************************************************************
1650 // *****************************************************************************
1651 // *****************************************************************************
1652 /* Function:
1653  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1654  const SYS_MODULE_INIT * const init);
1655  Summary:
1656  Initializes the Input Capture instance for the specified driver index.
1657  <p><b>Implementation:</b> Static</p>
1658  Description:
1659  This routine initializes the Input Capture driver instance for the specified
1660  driver instance, making it ready for clients to use it. The initialization
1661  routine is specified by the MHC parameters. The driver instance index is
1662  independent of the Input Capture module ID. For example, driver instance 0
1663  can be assigned to Input Capture 2.
1664  Precondition:
1665  None.
1666  Parameters:
1667  None.
1668  Returns:
1669  None.
1670  Remarks:
1671  This routine must be called before any other Input Capture routine is called.
1672  This routine should only be called once during system initialization.
1673 */
1674 
1675 SYS_MODULE_OBJ
1677  const SYS_MODULE_INDEX index ,
1678  const SYS_MODULE_INIT * const init ) ;
1679 // *****************************************************************************
1680 /* Function:
1681 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1682  Summary:
1683  Opens the Input Capture instance for the specified driver index.
1684  <p><b>Implementation:</b> Static</p>
1685  Description:
1686  This routine starts the Input Capture driver for the specified driver
1687  index, starting an input capture.
1688  Precondition:
1689  DRV_IC_Initialize has been called.
1690  Parameters:
1691  None.
1692  Returns:
1693  None.
1694  Remarks:
1695  None.
1696 */
1697 
1698 DRV_HANDLE
1699  DRV_IC_Open (
1700  const SYS_MODULE_INDEX drvIndex ,
1701  const DRV_IO_INTENT intent ) ;
1702 // *****************************************************************************
1703 /* Function:
1704  void DRV_IC_Close(DRV_HANDLE handle)
1705  Summary:
1706  Closes the Input Capture instance for the specified driver index.
1707  <p><b>Implementation:</b> Static</p>
1708  Description:
1709  This routine stops the Input Capture driver for the specified driver
1710  index, stopping an input capture.
1711  Precondition:
1712  DRV_IC_Initialize has been called.
1713  Parameters:
1714  None.
1715  Returns:
1716  None.
1717  Remarks:
1718  None.
1719 */
1720 
1721 void
1722  DRV_IC_Close (
1723  DRV_HANDLE handle ) ;
1724 // *****************************************************************************
1725 /* Function:
1726 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1727  Summary:
1728  Starts the Input Capture instance for the specified driver index.
1729  <p><b>Implementation:</b> Static</p>
1730  Description:
1731  This routine starts the Input Capture driver for the specified driver
1732  index, starting an input capture.
1733  Precondition:
1734  DRV_IC_Initialize has been called.
1735  Parameters:
1736  None.
1737  Returns:
1738  None.
1739  Remarks:
1740  None.
1741 */
1742 
1743 DRV_HANDLE
1744  DRV_IC_Start (
1745  const SYS_MODULE_INDEX drvIndex ,
1746  const DRV_IO_INTENT intent ) ;
1747 // *****************************************************************************
1748 /* Function:
1749  void DRV_IC_Stop(DRV_HANDLE handle)
1750  Summary:
1751  Stops the Input Capture instance for the specified driver index.
1752  <p><b>Implementation:</b> Static</p>
1753  Description:
1754  This routine stops the Input Capture driver for the specified driver
1755  index, stopping an input capture.
1756  Precondition:
1757  DRV_IC_Initialize has been called.
1758  Parameters:
1759  None.
1760  Returns:
1761  None.
1762  Remarks:
1763  None.
1764 */
1765 
1766 void
1767  DRV_IC_Stop (
1768  DRV_HANDLE handle ) ;
1769 // *****************************************************************************
1770 /* Function:
1771  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1772  Summary:
1773  Reads the 32-bit Input Capture for the specified driver index.
1774  <p><b>Implementation:</b> Static</p>
1775  Description:
1776  This routine reads the 32-bit data for the specified driver index
1777  Precondition:
1778  DRV_IC_Initialize has been called.
1779  Parameters:
1780  None.
1781  Returns:
1782  uint32_t value of the data read from the Input Capture.
1783  Remarks:
1784  None.
1785 */
1786 
1787 uint32_t
1789  DRV_HANDLE handle ) ;
1790 // *****************************************************************************
1791 /* Function:
1792  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1793  Summary:
1794  Reads the 16-bit Input Capture for the specified driver index.
1795  <p><b>Implementation:</b> Static</p>
1796  Description:
1797  This routine reads the 16-bit data for the specified driver index.
1798  Precondition:
1799  DRV_IC_Initialize has been called.
1800  Parameters:
1801  None.
1802  Returns:
1803  uint16_t value of the data read from the Input Capture.
1804  Remarks:
1805  None.
1806 */
1807 
1808 uint16_t
1810  DRV_HANDLE handle ) ;
1811 // *****************************************************************************
1812 /* Function:
1813  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1814  Summary:
1815  Returns the Input Capture instance buffer empty status for the specified driver
1816  index.
1817  <p><b>Implementation:</b> Static</p>
1818  Description:
1819  Returns the Input Capture instance buffer empty status for the specified driver
1820  index. The function should be called to determine whether or not the IC buffer
1821  has data.
1822  Precondition:
1823  DRV_IC_Initialize has been called.
1824  Parameters:
1825  None.
1826  Returns:
1827  Boolean
1828  - 1 - Buffer is empty
1829  - 0 - Buffer is not empty
1830  Remarks:
1831  None.
1832 */
1833 
1834 bool
1836  DRV_HANDLE handle ) ;
1837 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1838 /*******************************************************************************
1839  IC Driver Interface Declarations for Static Single Instance Driver
1840  Company:
1841  Microchip Technology Inc.
1842  File Name:
1843  drv_ic_static.h
1844  Summary:
1845  IC driver interface declarations for the static single instance driver.
1846  Description:
1847  The IC device driver provides a simple interface to manage the IC
1848  modules on Microchip microcontrollers. This file defines the interface
1849  Declarations for the IC driver.
1850 
1851  Remarks:
1852  Static interfaces incorporate the driver instance number within the names
1853  of the routines, eliminating the need for an object ID or object handle.
1854 
1855  Static single-open interfaces also eliminate the need for the open handle.
1856 *******************************************************************************/
1857 //DOM-IGNORE-BEGIN
1858 /*******************************************************************************
1859 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1860 Microchip licenses to you the right to use, modify, copy and distribute
1861 Software only when embedded on a Microchip microcontroller or digital signal
1862 controller that is integrated into your product or third party product
1863 (pursuant to the sublicense terms in the accompanying license agreement).
1864 You should refer to the license agreement accompanying this Software for
1865 additional information regarding your rights and obligations.
1866 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1867 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1868 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1869 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1870 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1871 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1872 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1873 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1874 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1875 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1876 *******************************************************************************/
1877 //DOM-IGNORE-END
1878 #ifndef _DRV_IC_STATIC_H
1879 #define _DRV_IC_STATIC_H
1880 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1881 #define DRV_IC_Close( handle )
1882 // *****************************************************************************
1883 // *****************************************************************************
1884 // Section: Interface Headers for Instance 0 for the static driver
1885 // *****************************************************************************
1886 // *****************************************************************************
1887 
1888 void
1889  DRV_IC0_Initialize ( void ) ;
1890 
1891 void
1892  DRV_IC0_Start ( void ) ;
1893 
1894 void
1895  DRV_IC0_Stop ( void ) ;
1896 
1897 uint32_t
1898  DRV_IC0_Capture32BitDataRead ( void ) ;
1899 
1900 uint16_t
1901  DRV_IC0_Capture16BitDataRead ( void ) ;
1902 
1903 bool
1904  DRV_IC0_BufferIsEmpty ( void ) ;
1905  // #ifndef _DRV_IC_STATIC_H
1906 /*******************************************************************************
1907  End of File
1908 */
1909 
1910 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1911 /* CLOSE_FILE Include File */
1912 
1913  // #ifndef _DRV_IC_H
1914 /*******************************************************************************
1915  End of File
1916 */
1917 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1918 /* CLOSE_FILE Include File */
1919 
1920 #include "system/devcon/sys_devcon.h"
1921 #include "system/clk/sys_clk.h"
1922 #include "system/int/sys_int.h"
1923 #include "system/tmr/sys_tmr.h"
1924 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1925 /*******************************************************************************
1926  ADC Driver Interface Declarations for Static Single Instance Driver
1927  Company:
1928  Microchip Technology Inc.
1929  File Name:
1930  drv_adc_static.h
1931  Summary:
1932  ADC driver interface declarations for the static single instance driver.
1933  Description:
1934  The ADC device driver provides a simple interface to manage the ADC
1935  modules on Microchip microcontrollers. This file defines the interface
1936  Declarations for the ADC driver.
1937 
1938  Remarks:
1939  Static interfaces incorporate the driver instance number within the names
1940  of the routines, eliminating the need for an object ID or object handle.
1941 
1942  Static single-open interfaces also eliminate the need for the open handle.
1943 *******************************************************************************/
1944 //DOM-IGNORE-BEGIN
1945 /*******************************************************************************
1946 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1947 Microchip licenses to you the right to use, modify, copy and distribute
1948 Software only when embedded on a Microchip microcontroller or digital signal
1949 controller that is integrated into your product or third party product
1950 (pursuant to the sublicense terms in the accompanying license agreement).
1951 You should refer to the license agreement accompanying this Software for
1952 additional information regarding your rights and obligations.
1953 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1954 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1955 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1956 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1957 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1958 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1959 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1960 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1961 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1962 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1963 *******************************************************************************/
1964 //DOM-IGNORE-END
1965 #ifndef _DRV_ADC_STATIC_H
1966 #define _DRV_ADC_STATIC_H
1967 #include <stdbool.h>
1968 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1969 #include "peripheral/adchs/plib_adchs.h"
1970 #include "peripheral/int/plib_int.h"
1971 
1972 typedef
1973  enum
1974  {
1975  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1977  } DRV_ADC_MODULE_ID ;
1978 // *****************************************************************************
1979 // *****************************************************************************
1980 // Section: Interface Headers for ADC Static Driver
1981 // *****************************************************************************
1982 // *****************************************************************************
1983 
1984 void
1985  DRV_ADC_Initialize ( void ) ;
1986 
1987 inline void
1988  DRV_ADC_DeInitialize ( void ) ;
1989 
1990 inline void
1991  DRV_ADC0_Open ( void ) ;
1992 
1993 inline void
1994  DRV_ADC0_Close ( void ) ;
1995 
1996 inline void
1997  DRV_ADC1_Open ( void ) ;
1998 
1999 inline void
2000  DRV_ADC1_Close ( void ) ;
2001 
2002 inline void
2003  DRV_ADC_Start ( void ) ;
2004 
2005 inline void
2006  DRV_ADC_Stop ( void ) ;
2007 
2008 uint32_t
2010  uint8_t bufIndex ) ;
2011 
2012 bool
2014  uint8_t bufIndex ) ;
2015  // #ifndef _DRV_ADC_STATIC_H
2016 /*******************************************************************************
2017  End of File
2018 */
2019 
2020 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
2021 /* CLOSE_FILE Include File */
2022 
2023 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
2024 /*******************************************************************************
2025  Timer Driver Interface Declarations for Static Single Instance Driver
2026  Company:
2027  Microchip Technology Inc.
2028  File Name:
2029  drv_tmr_static.h
2030  Summary:
2031  Timer driver interface declarations for the static single instance driver.
2032  Description:
2033  The Timer device driver provides a simple interface to manage the Timer
2034  modules on Microchip microcontrollers. This file defines the interface
2035  Declarations for the TMR driver.
2036 
2037  Remarks:
2038  Static interfaces incorporate the driver instance number within the names
2039  of the routines, eliminating the need for an object ID or object handle.
2040 
2041  Static single-open interfaces also eliminate the need for the open handle.
2042 *******************************************************************************/
2043 //DOM-IGNORE-BEGIN
2044 /*******************************************************************************
2045 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
2046 Microchip licenses to you the right to use, modify, copy and distribute
2047 Software only when embedded on a Microchip microcontroller or digital signal
2048 controller that is integrated into your product or third party product
2049 (pursuant to the sublicense terms in the accompanying license agreement).
2050 You should refer to the license agreement accompanying this Software for
2051 additional information regarding your rights and obligations.
2052 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2053 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2054 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
2055 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
2056 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2057 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2058 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2059 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2060 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
2061 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2062 *******************************************************************************/
2063 //DOM-IGNORE-END
2064 #ifndef _DRV_TMR_STATIC_H
2065 #define _DRV_TMR_STATIC_H
2066 // *****************************************************************************
2067 // *****************************************************************************
2068 // Section: Include Headers
2069 // *****************************************************************************
2070 // *****************************************************************************
2071 #include <stdint.h>
2072 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
2073 /*******************************************************************************
2074  Timer Device Driver Interface Definition
2075  Company:
2076  Microchip Technology Inc.
2077  File Name:
2078  drv_tmr.h
2079  Summary:
2080  Timer device driver interface header file.
2081  Description:
2082  This header file contains the function prototypes and definitions of the
2083  data types and constants that make up the interface to the Timer device
2084  driver.
2085 *******************************************************************************/
2086 //DOM-IGNORE-BEGIN
2087 /*******************************************************************************
2088 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2089 Microchip licenses to you the right to use, modify, copy and distribute
2090 Software only when embedded on a Microchip microcontroller or digital signal
2091 controller that is integrated into your product or third party product
2092 (pursuant to the sublicense terms in the accompanying license agreement).
2093 You should refer to the license agreement accompanying this Software for
2094 additional information regarding your rights and obligations.
2095 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2096 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2097 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2098 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2099 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2100 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2101 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2102 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2103 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2104 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2105 *******************************************************************************/
2106 //DOM-IGNORE-END
2107 #ifndef _DRV_TMR_H
2108 #define _DRV_TMR_H
2109 // *****************************************************************************
2110 // *****************************************************************************
2111 // Section: File includes
2112 // *****************************************************************************
2113 // *****************************************************************************
2114 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
2115 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
2116 #include "peripheral/tmr/plib_tmr.h"
2117 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
2118 /*******************************************************************************
2119  Timer Device Driver Interface Definition
2120  Company:
2121  Microchip Technology Inc.
2122  File Name:
2123  tmr_definitions_pic32m.h
2124  Summary:
2125  Timer device driver definitions header file.
2126  Description:
2127  This header file contains the definitions of the
2128  data types and constants that make up the interface to the Timer device
2129  driver.
2130 *******************************************************************************/
2131 //DOM-IGNORE-BEGIN
2132 /*******************************************************************************
2133 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2134 Microchip licenses to you the right to use, modify, copy and distribute
2135 Software only when embedded on a Microchip microcontroller or digital signal
2136 controller that is integrated into your product or third party product
2137 (pursuant to the sublicense terms in the accompanying license agreement).
2138 You should refer to the license agreement accompanying this Software for
2139 additional information regarding your rights and obligations.
2140 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2141 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2142 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2143 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2144 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2145 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2146 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2147 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2148 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2149 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2150 *******************************************************************************/
2151 //DOM-IGNORE-END
2152 #ifndef _TMR_DEFINITIONS_PIC32M_H
2153 #define _TMR_DEFINITIONS_PIC32M_H
2154 // DOM-IGNORE-BEGIN
2155 // DOM-IGNORE-END
2156 
2157 typedef
2158  enum
2159  {
2160  /* Clock input to the timer module is internal(Peripheral Clock) */
2162  /*DOM-IGNORE-BEGIN*/
2163  = 0x00 /*DOM-IGNORE-END*/
2164  ,
2165  /* Clock input to the timer module is from T1CK pin (external)
2166  with clock synchronization enabled */
2168  /*DOM-IGNORE-BEGIN*/
2169  = 0x01 /*DOM-IGNORE-END*/
2170  ,
2171  /* Clock input to the timer module is from T1CK pin (external)
2172  with clock synchronization disabled */
2174  /*DOM-IGNORE-BEGIN*/
2175  = 0x11 /*DOM-IGNORE-END*/
2176  ,
2177  /* Clock input to the timer module is from secondary oscillator (external)
2178  with clock synchronization enabled */
2180  /*DOM-IGNORE-BEGIN*/
2181  = 0x02 /*DOM-IGNORE-END*/
2182  ,
2183  /* Clock input to the timer module is from secondary oscillator (external)
2184  with clock synchronization disabled */
2186  /*DOM-IGNORE-BEGIN*/
2187  = 0x12 /*DOM-IGNORE-END*/
2188  ,
2189  /* Clock input to the timer module is from LPRC
2190  with clock synchronization enabled */
2192  /*DOM-IGNORE-BEGIN*/
2193  = 0x03 /*DOM-IGNORE-END*/
2194  ,
2195  /* Clock input to the timer module is from LPRC
2196  with clock synchronization disabled */
2198  /*DOM-IGNORE-BEGIN*/
2199  = 0x13 /*DOM-IGNORE-END*/
2201 //DOM-IGNORE-BEGIN
2202 //DOM-IGNORE-END
2203  // #ifndef _DRV_TMR_H
2204 /*******************************************************************************
2205  End of File
2206 */
2207 
2208 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
2209 /* CLOSE_FILE Include File */
2210 
2211 #include "system/int/sys_int.h" // System Interrupt Definitions
2212 #include "system/clk/sys_clk.h"
2213 // DOM-IGNORE-BEGIN
2214 // DOM-IGNORE-END
2215 // *****************************************************************************
2216 // *****************************************************************************
2217 // Section: TMR Driver Data Types
2218 // *****************************************************************************
2219 // *****************************************************************************
2220 // *****************************************************************************
2221 /* Timer Driver Module Index Numbers
2222  Summary:
2223  Timer driver index definitions
2224  Description:
2225  These constants provide Timer driver index definitions.
2226  Remarks:
2227  These constants should be used in place of hard-coded numeric literals.
2228  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
2229  functions to identify the driver instance in use.
2230 */
2231 #define DRV_TMR_INDEX_0 0
2232 #define DRV_TMR_INDEX_1 1
2233 #define DRV_TMR_INDEX_2 2
2234 #define DRV_TMR_INDEX_3 3
2235 #define DRV_TMR_INDEX_4 4
2236 #define DRV_TMR_INDEX_5 5
2237 #define DRV_TMR_INDEX_6 6
2238 #define DRV_TMR_INDEX_7 7
2239 #define DRV_TMR_INDEX_8 8
2240 #define DRV_TMR_INDEX_9 9
2241 #define DRV_TMR_INDEX_10 10
2242 #define DRV_TMR_INDEX_11 11
2243 // *****************************************************************************
2244 /* Timer Driver Module Index Count
2245  Summary:
2246  Number of valid Timer driver indices.
2247  Description:
2248  This constant identifies Timer driver index definitions.
2249  Remarks:
2250  This constant should be used in place of hard-coded numeric literals.
2251  This value is device-specific.
2252 */
2253 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
2254 // *****************************************************************************
2255 /* Timer Driver Client Status
2256  Summary:
2257  Identifies the client-specific status of the Timer driver
2258  Description:
2259  This enumeration identifies the client-specific status of the Timer driver.
2260  Remarks:
2261  None.
2262 */
2263 
2264 typedef
2265  enum
2266  {
2267  /* Driver is invalid (or unopened) state */
2269  /*DOM-IGNORE-BEGIN*/
2270  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
2271  ,
2272  /* An operation is currently in progress */
2274  /*DOM-IGNORE-BEGIN*/
2275  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
2276  ,
2277  /* Ready, no operations running */
2279  /*DOM-IGNORE-BEGIN*/
2280  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
2281  ,
2282  /* Timer started and running, processing transactions */
2284  /*DOM-IGNORE-BEGIN*/
2285  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
2287 // *****************************************************************************
2288 /* Timer Driver Clock sources
2289  Summary:
2290  Lists the clock sources available for timer driver.
2291  Description:
2292  This enumeration lists all the available clock sources for the timer
2293  hardware.
2294  Remarks:
2295  Not all modes are available on all devices.
2296  'Synchronization' may not be applicable for all the instances of the timer.
2297  The driver discards the Synchronization mode selected if it is not
2298  applicable for the selected hardware.
2299 */
2300 // *****************************************************************************
2301 /* Timer Driver Operation mode
2302  Summary:
2303  Lists the operation modes available for timer driver.
2304  Description:
2305  This enumeration lists all the available operation modes that are valid for
2306  the timer hardware.
2307  Remarks:
2308  Not all modes are available on all devices.
2309 */
2310 
2311 typedef
2312  enum
2313  {
2314  /* The timer module operating mode none/invalid */
2316  /* The timer module operates in 16 bit mode */
2318  /* The timer module operates in 32 bit mode */
2319  /* This will combine two 16 bit timer modules */
2322 // *****************************************************************************
2323 /* Timer Driver divider operating specification
2324  Summary:
2325  This data structure specifies the divider values that can be obtained by the
2326  timer module.
2327  Description:
2328  This data structure specifies the divider values that can be obtained by the
2329  timer hardware.
2330  Remarks:
2331  None.
2332 */
2333 
2334 typedef
2335  struct
2336  {
2337  /* The minimum divider value that the timer module can obtain */
2338  uint32_t dividerMin ;
2339  /* The maximum divider value that the timer module can obtain */
2340  uint32_t dividerMax ;
2341  /* The divider step value, between 2 divider values */
2342  /* Should be 1 for most timers */
2343  uint32_t dividerStep ;
2345 // *****************************************************************************
2346 /* Timer Driver Initialize Data
2347  Summary:
2348  Defines the Timer driver initialization data.
2349  Description:
2350  This data type defines data required to initialize the Timer driver.
2351  Remarks:
2352  Not all initialization features are available on all devices.
2353 */
2354 
2355 typedef
2356  struct
2357  {
2358  /* System module initialization. */
2359  SYS_MODULE_INIT moduleInit ;
2360  /* Identifies timer hardware module (PLIB-level) ID */
2361  TMR_MODULE_ID tmrId ;
2362  /* Clock Source select. */
2363  DRV_TMR_CLK_SOURCES clockSource ;
2364  /* Prescaler Selection from the processor enumeration */
2365  TMR_PRESCALE prescale ;
2366  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
2367  is selected the interrupt will be generated by the 2nd timer of the pair,
2368  the odd numbered one. */
2369  INT_SOURCE interruptSource ;
2370  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
2371  timer modules to form a 32 bit one. This is usually only necessary for
2372  very long delays. */
2373  DRV_TMR_OPERATION_MODE mode ;
2374  /* Asynchronous write enable configuration. If true the asynchronous write
2375  is enabled. For timers that do not support this feature the value is
2376  ignored */
2377  bool asyncWriteEnable ;
2378  } DRV_TMR_INIT ;
2379 // *****************************************************************************
2380 /* Timer Driver Callback Function Pointer
2381  Summary:
2382  Pointer to a Timer driver callback function data type.
2383  Description:
2384  This data type defines a pointer to a Timer driver callback function.
2385  Remarks:
2386  Useful only when timer alarm callback support is enabled by defining the
2387  DRV_TMR_ALARM_ENABLE configuration option.
2388 */
2389 
2390 typedef
2391 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
2392 uint32_t alarmCount ) ;
2393 // *****************************************************************************
2394 // *****************************************************************************
2395 // Section: Timer Driver Module Interface Functions
2396 // *****************************************************************************
2397 // *****************************************************************************
2398 // *****************************************************************************
2399 /* Function:
2400  SYS_MODULE_OBJ DRV_TMR_Initialize
2401  (
2402  const SYS_MODULE_INDEX drvIndex,
2403  const SYS_MODULE_INIT * const init
2404  )
2405  Summary:
2406  Initializes the Timer driver.
2407  <p><b>Implementation:</b> Static/Dynamic</p>
2408  Description:
2409  This function initializes the Timer driver, making it ready for clients to
2410  open and use it.
2411  Precondition:
2412  None.
2413  Parameters:
2414  drvIndex - Index for the driver instance to be initialized
2415  init - Pointer to a data structure containing any data necessary
2416  to initialize the driver.
2417  Returns:
2418  If successful, returns a valid handle to a driver object. Otherwise, it
2419  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
2420  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
2421  Example:
2422  <code>
2423  DRV_TMR_INIT init;
2424  SYS_MODULE_OBJ objectHandle;
2425  // Populate the timer initialization structure
2426  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
2427  init.tmrId = TMR_ID_2;
2428  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
2429  init.prescale = TMR_PRESCALE_VALUE_256;
2430  init.interruptSource = INT_SOURCE_TIMER_2;
2431  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
2432  init.asyncWriteEnable = false;
2433  // Do something
2434  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
2435  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
2436  {
2437  // Handle error
2438  }
2439  </code>
2440  Remarks:
2441  This function must be called before any other Timer driver function is
2442  called.
2443  This function should only be called once during system initialization unless
2444  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
2445  This function will NEVER block for hardware access. The system must use
2446  DRV_TMR_Status to find out when the driver is in the ready state.
2447  Build configuration options may be used to statically override options in
2448  the "init" structure and will take precedence over initialization data
2449  passed using this function.
2450 */
2451 
2452 SYS_MODULE_OBJ
2454  const SYS_MODULE_INDEX drvIndex ,
2455  const SYS_MODULE_INIT * const init ) ;
2456 // *****************************************************************************
2457 /* Function:
2458  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
2459  Summary:
2460  Deinitializes the specified instance of the Timer driver.
2461  <p><b>Implementation:</b> Dynamic</p>
2462  Description:
2463  Deinitializes the specified instance of the Timer driver, disabling
2464  its operation (and any hardware). All internal data is invalidated.
2465  Precondition:
2466  The DRV_TMR_Initialize function must have been called before calling this
2467  function and a valid SYS_MODULE_OBJ must have been returned.
2468  Parameters:
2469  object - Driver object handle, returned from DRV_TMR_Initialize
2470  Returns:
2471  None.
2472  Example:
2473  <code>
2474  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
2475  SYS_STATUS tmrStatus;
2476  DRV_TMR_Deinitialize ( tmrObject );
2477  tmrStatus = DRV_TMR_Status ( tmrObject );
2478  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
2479  {
2480  // Check again later if you need to know
2481  // when the driver is deinitialized.
2482  }
2483  </code>
2484  Remarks:
2485  Once the Initialize operation has been called, the Deinitialize operation
2486  must be called before the Initialize operation can be called again.
2487  This function will NEVER block waiting for hardware. If the operation
2488  requires time to allow the hardware to complete, this will be reported by
2489  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
2490  out when the module is in the ready state.
2491 */
2492 
2493 void
2495  SYS_MODULE_OBJ object ) ;
2496 // *****************************************************************************
2497 /* Function:
2498  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
2499  Summary:
2500  Provides the current status of the Timer driver.
2501  <p><b>Implementation:</b> Dynamic</p>
2502  Description:
2503  This function provides the current status of the Timer driver.
2504  Precondition:
2505  The DRV_TMR_Initialize function must have been called before calling this
2506  function.
2507  Parameters:
2508  object - Driver object handle, returned from DRV_TMR_Initialize
2509  Returns:
2510  SYS_STATUS_READY - Indicates that the driver is initialized and ready
2511  for operation
2512  Note: Any value greater than SYS_STATUS_READY is
2513  also a normal running state in which the driver
2514  is ready to accept new operations.
2515  SYS_STATUS_ERROR - Indicates that the driver is in an error state
2516  Note: Any value less than SYS_STATUS_ERROR is
2517  also an error state.
2518  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
2519  Note: This value is less than SYS_STATUS_ERROR.
2520  Example:
2521  <code>
2522  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2523  SYS_STATUS tmrStatus;
2524  tmrStatus = DRV_TMR_Status ( object );
2525  else if ( SYS_STATUS_ERROR >= tmrStatus )
2526  {
2527  // Handle error
2528  }
2529  </code>
2530  Remarks:
2531  The this operation can be used to determine when any of the driver's module
2532  level operations has completed.
2533  Once the status operation returns SYS_STATUS_READY, the driver is ready for
2534  operation.
2535  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
2536  also an error state.
2537  This function will NEVER block waiting for hardware.
2538 */
2539 
2540 SYS_STATUS
2541  DRV_TMR_Status (
2542  SYS_MODULE_OBJ object ) ;
2543 // *****************************************************************************
2544 /* Function:
2545  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
2546  Summary:
2547  Maintains the driver's state machine.
2548  <p><b>Implementation:</b> Dynamic</p>
2549  Description:
2550  This function is used to maintain the driver's internal state machine and
2551  processes the timer events..
2552  Precondition:
2553  The DRV_TMR_Initialize function must have been called for the specified Timer
2554  driver instance.
2555  Parameters:
2556  object - Object handle for the specified driver instance (returned from
2557  DRV_TMR_Initialize)
2558  Returns:
2559  None
2560  Example:
2561  <code>
2562  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2563  while (true)
2564  {
2565  DRV_TMR_Tasks ( object );
2566  // Do other tasks
2567  }
2568  </code>
2569  Remarks:
2570  This function is normally not called directly by an application. It is
2571  called by the system's Tasks routine (SYS_Tasks)
2572 */
2573 
2574 void
2575  DRV_TMR_Tasks (
2576  SYS_MODULE_OBJ object ) ;
2577 // *****************************************************************************
2578 // *****************************************************************************
2579 // Section: TMR Driver Client Functions
2580 // *****************************************************************************
2581 // *****************************************************************************
2582 // *****************************************************************************
2583 /* Function:
2584  DRV_HANDLE DRV_TMR_Open
2585  (
2586  const SYS_MODULE_INDEX index,
2587  const DRV_IO_INTENT intent
2588  )
2589  Summary:
2590  Opens the specified Timer driver instance and returns a handle to it.
2591  <p><b>Implementation:</b> Dynamic</p>
2592  Description:
2593  This function opens the specified Timer driver instance and provides a
2594  handle that must be provided to all other client-level operations to
2595  identify the caller and the instance of the driver. Timer driver does not
2596  support multiple clients. If two tasks want to use the timer, one should
2597  wait until the other one gets closed.
2598  Precondition:
2599  The DRV_TMR_Initialize function must have been called before calling this
2600  function.
2601  Parameters:
2602  index - Identifier for the object instance to be opened
2603  intent - Zero or more of the values from the enumeration
2604  DRV_IO_INTENT ORed together to indicate the intended use
2605  of the driver
2606  Returns:
2607  If successful, the function returns a valid open instance handle (a number
2608  identifying both the caller and the module instance).
2609  If an error occurs, the return value is DRV_HANDLE_INVALID.
2610  Example:
2611  <code>
2612  DRV_HANDLE handle;
2613  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2614  if ( DRV_HANDLE_INVALID == handle )
2615  {
2616  // Unable to open the driver
2617  }
2618  </code>
2619  Remarks:
2620  The handle returned is valid until the DRV_TMR_Close function is called.
2621  This function will NEVER block waiting for hardware.
2622  If the requested intent flags are not supported, the function will return
2623  DRV_HANDLE_INVALID.
2624  The Timer driver does not support DRV_IO_INTENT_SHARED.
2625  Only exclusive access is supported for now.
2626 */
2627 
2628 DRV_HANDLE
2629  DRV_TMR_Open (
2630  const SYS_MODULE_INDEX index ,
2631  const DRV_IO_INTENT intent ) ;
2632 // *****************************************************************************
2633 /* Function:
2634  void DRV_TMR_Close ( DRV_HANDLE handle )
2635  Summary:
2636  Closes an opened instance of the Timer driver.
2637  <p><b>Implementation:</b> Dynamic</p>
2638  Description:
2639  This function closes an opened instance of the Timer driver, invalidating
2640  the handle.
2641  Precondition:
2642  The DRV_TMR_Initialize function must have been called for the specified
2643  Timer driver instance.
2644  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2645  Parameters:
2646  handle - A valid open-instance handle, returned from the driver's
2647  open routine
2648  Returns:
2649  None
2650  Example:
2651  <code>
2652  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2653  DRV_TMR_Close ( handle );
2654  </code>
2655  Remarks:
2656  After calling this function, the handle passed in "handle" must not be used
2657  with any of the remaining driver functions. A new handle must be obtained
2658  by calling DRV_TMR_Open before the caller may use the driver again.
2659  Note: Usually there is no need for the driver client to verify that the Close
2660  operation has completed.
2661 */
2662 
2663 void
2664  DRV_TMR_Close (
2665  DRV_HANDLE handle ) ;
2666 // *****************************************************************************
2667 /* Function:
2668  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2669  Summary:
2670  Gets the status of the client operation.
2671  <p><b>Implementation:</b> Dynamic</p>
2672  Description:
2673  This function gets the status of the recently completed client level
2674  operation.
2675  Precondition:
2676  The DRV_TMR_Initialize function must have been called for the specified
2677  Timer driver instance.
2678  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2679  Parameters:
2680  handle - A valid open-instance handle, returned from the driver's
2681  open routine
2682  Returns:
2683  None
2684  Example:
2685  <code>
2686  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2687  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2688  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2689  </code>
2690  Remarks:
2691  None.
2692 */
2693 
2696  DRV_HANDLE handle ) ;
2697 // *****************************************************************************
2698 // *****************************************************************************
2699 // Section: TMR Driver Counting functions
2700 // *****************************************************************************
2701 // *****************************************************************************
2702 // *****************************************************************************
2703 /* Function:
2704  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2705  Summary:
2706  Updates the Timer's counter register.
2707  <p><b>Implementation:</b> Static/Dynamic</p>
2708  Description:
2709  This function updates the Timer's value in the counter register.
2710  Precondition:
2711  The DRV_TMR_Initialize function must have been called.
2712  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2713  Parameters:
2714  handle - A valid open-instance handle, returned from the driver's
2715  open routine
2716  counterPeriod - counter period value
2717  - a 16 bit value if the timer is configured in 16 bit mode
2718  - a 32 bit value if the timer is configured in 32 bit mode
2719  Returns:
2720  None.
2721  Example:
2722  <code>
2723  </code>
2724  Remarks:
2725  None.
2726 */
2727 
2728 void
2730  DRV_HANDLE handle ,
2731  uint32_t counterPeriod ) ;
2732 // *****************************************************************************
2733 /* Function:
2734  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2735  Summary:
2736  Reads the Timer's counter register.
2737  <p><b>Implementation:</b> Static/Dynamic</p>
2738  Description:
2739  This function returns the Timer's value in the counter register.
2740  Precondition:
2741  The DRV_TMR_Initialize function must have been called.
2742  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2743  Parameters:
2744  handle - A valid open-instance handle, returned from the driver's
2745  open routine
2746  Returns:
2747  Timer current period:
2748  - a 16 bit value if the timer is configured in 16 bit mode
2749  - a 32 bit value if the timer is configured in 32 bit mode
2750  Example:
2751  <code>
2752  //Example to use timer for precision time measurement
2753  //without configuring an alarm (interrupt based)
2754  char appState = 0;
2755  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2756  switch ( appState )
2757  {
2758  case 0:
2759  //Calculate and set the counter period
2760  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2761  //counter starts
2762  DRV_TMR_Start ( tmrHandle );
2763  //Trigger an application operation
2764  app_trigger_operation();
2765  //Check for time-out in the next state
2766  appState++;
2767  case 1:
2768  //Overflows and stops at 0 if no alarm is set
2769  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2770  {
2771  //Time-out
2772  return false;
2773  }
2774  else if ( app_operation_isComplete( ) )
2775  {
2776  //Operation is complete before time-out
2777  return true;
2778  }
2779  </code>
2780  Remarks:
2781  None.
2782 */
2783 
2784 uint32_t
2786  DRV_HANDLE handle ) ;
2787 // *****************************************************************************
2788 /* Function:
2789  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2790  Summary:
2791  Clears the Timer's counter register.
2792  <p><b>Implementation:</b> Static/Dynamic</p>
2793  Description:
2794  This function clears the Timer's value in the counter register.
2795  Precondition:
2796  The DRV_TMR_Initialize function must have been called.
2797  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2798  Parameters:
2799  handle - A valid open-instance handle, returned from the driver's
2800  open routine
2801  Returns:
2802  None.
2803  Example:
2804  <code>
2805  </code>
2806  Remarks:
2807  None.
2808 */
2809 
2810 void
2812  DRV_HANDLE handle ) ;
2813 // *****************************************************************************
2814 /* Function:
2815  bool DRV_TMR_AlarmRegister
2816  (
2817  DRV_HANDLE handle,
2818  uint32_t divider,
2819  bool isPeriodic,
2820  uintptr_t context,
2821  DRV_TMR_CALLBACK callBack
2822  )
2823  Summary:
2824  Sets up an alarm.
2825  <p><b>Implementation:</b> Dynamic</p>
2826  Description:
2827  This function sets up an alarm, allowing the client to receive a callback
2828  from the driver when the timer counter reaches zero. Alarms can be one-shot
2829  or periodic. A periodic alarm will reload the timer and generate alarm
2830  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2831  divider;
2832  Precondition:
2833  The DRV_TMR_Initialize function must have been called.
2834  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2835  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2836  Parameters:
2837  handle - A valid handle, returned from DRV_TMR_Open
2838  divider - The value to divide the timer clock source to obtain the
2839  required alarm frequency.
2840  - a 16 bit value if the timer is configured in 16 bit mode
2841  - a 32 bit value if the timer is configured in 32 bit mode
2842  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2843  context - A reference, call back function will be called with the same
2844  reference.
2845  callBack - A call back function which will be called on time out.
2846  Returns:
2847  - true - if the call succeeded
2848  - false - the obtained divider could not be obtained or the passed handle was invalid
2849  Example:
2850  <code>
2851  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2852  void setupTask ()
2853  {
2854  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2855  uint32_t myFreq = 1000; // 1KHz
2856  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2857  // calculate the divider needed
2858  uint32_t divider = clkFreq / myFreq;
2859  // Start the alarm
2860  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2861  {
2862  // divider value could not be obtain;
2863  // handle the error
2864  //
2865  }
2866  }
2867  </code>
2868  Remarks:
2869  The divider value will be truncated to a 16 bit value if the timer is
2870  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2871  callback.
2872 */
2873 
2874 bool
2876  DRV_HANDLE handle ,
2877  uint32_t divider ,
2878  bool isPeriodic ,
2879  uintptr_t context ,
2880  DRV_TMR_CALLBACK callBack ) ;
2881 // *****************************************************************************
2882 /* Function:
2883  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2884  Summary:
2885  Disables an alarm signal.
2886  <p><b>Implementation:</b> Dynamic</p>
2887  Description:
2888  This function allows the client to disable an alarm generation.
2889  Use DRV_TMR_AlarmEnable to re-enable.
2890  Precondition:
2891  The DRV_TMR_Initialize function must have been called.
2892  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2893  A client alarm must be active.
2894  Parameters:
2895  handle - A valid handle, returned from DRV_TMR_Open
2896  Returns:
2897  The current status of the alarm:
2898  - true if the alarm was currently enabled
2899  - false if the alarm was currently disabled
2900  Example:
2901  <code>
2902  </code>
2903  Remarks:
2904  When the driver operates in interrupts this call resolves to a device
2905  interrupt disable.
2906  Do NOT disable the timer except for very short periods of time. If the time
2907  that the interrupt is disabled is longer than a wrap around period and the
2908  interrupt is missed, the hardware has no means of recovering and the
2909  resulting timing will be inaccurate.
2910 */
2911 
2912 bool
2914  DRV_HANDLE handle ) ;
2915 // *****************************************************************************
2916 /* Function:
2917  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2918  Summary:
2919  Re-enables an alarm signal.
2920  <p><b>Implementation:</b> Dynamic</p>
2921  Description:
2922  This function allows the client to re-enable an alarm after it has been
2923  disabled by a DRV_TMR_AlarmDisable call.
2924  Precondition:
2925  The DRV_TMR_Initialize function must have been called.
2926  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2927  Parameters:
2928  handle - A valid handle, returned from DRV_TMR_Open
2929  enable - boolean to enable the current callback
2930  Returns:
2931  None
2932  Example:
2933  <code>
2934  </code>
2935  Remarks:
2936  When the driver operates in interrupts this call resolves to a device
2937  interrupt re-enable.
2938 */
2939 
2940 void
2942  DRV_HANDLE handle ,
2943  bool enable ) ;
2944 // *****************************************************************************
2945 /* Function:
2946  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2947  Summary:
2948  Updates the Timer's period.
2949  <p><b>Implementation:</b> Dynamic</p>
2950  Description:
2951  This function updates the Timer's period.
2952  Precondition:
2953  The DRV_TMR_Initialize function must have been called.
2954  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2955  Parameters:
2956  handle - A valid open-instance handle, returned from the driver's
2957  open routine
2958  value - Period value
2959  - a 16 bit value if the timer is configured in 16 bit mode
2960  - a 32 bit value if the timer is configured in 32 bit mode
2961  Returns:
2962  None.
2963  Example:
2964  <code>
2965  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2966  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2967  </code>
2968  Remarks:
2969  - The period value will be truncated to a 16 bit value if the timer is
2970  configured in 16 bit mode.
2971 */
2972 
2973 void
2975  DRV_HANDLE handle ,
2976  uint32_t value ) ;
2977 // *****************************************************************************
2978 /* Function:
2979  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2980  Summary:
2981  Provides the Timer's period.
2982  <p><b>Implementation:</b> Dynamic</p>
2983  Description:
2984  This function gets the Timer's period.
2985  Precondition:
2986  The DRV_TMR_Initialize function must have been called.
2987  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2988  Parameters:
2989  handle - A valid open-instance handle, returned from the driver's
2990  open routine
2991  Returns:
2992  Timer period value:
2993  - a 16 bit value if the timer is configured in 16 bit mode
2994  - a 32 bit value if the timer is configured in 32 bit mode
2995  Example:
2996  <code>
2997  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2998  uint32_t period;
2999  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
3000  </code>
3001  Remarks:
3002  None.
3003 */
3004 
3005 uint32_t
3007  DRV_HANDLE handle ) ;
3008 // *****************************************************************************
3009 /* Function:
3010  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
3011  Summary:
3012  Removes a previously set alarm.
3013  <p><b>Implementation:</b> Dynamic</p>
3014  Description:
3015  This function removes a previously set alarm.
3016  Precondition:
3017  The DRV_TMR_Initialize function must have been called.
3018  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3019  DRV_TMR_AlarmRegister function must have been called before.
3020  Parameters:
3021  handle - A valid open-instance handle, returned from the driver's
3022  open routine
3023  Returns:
3024  None.
3025  Example:
3026  <code>
3027  // Example of a key debounce check
3028  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3029  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3030  void keyPressDetect ()
3031  {
3032  // Calculate the count to be passed on from the clock input
3033  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
3034  }
3035  void DebounceCheck ( uintptr_t context )
3036  {
3037  readKey = AppReadKey();
3038  if ( readKey != lastReadKey )
3039  {
3040  lastReadKey = readKey;
3041  keyCount = 0;
3042  }
3043  else
3044  {
3045  if ( keyCount > 20 )
3046  {
3047  globalKeyState = readKey;
3048  DRV_TMR_AlarmDeregister ( tmrHandle );
3049  }
3050  keyCount++;
3051  }
3052  }
3053  </code>
3054  Remarks:
3055  None.
3056 */
3057 
3058 void
3060  DRV_HANDLE handle ) ;
3061 // *****************************************************************************
3062 // *****************************************************************************
3063 // Section: TMR Driver Operation Control Functions
3064 // *****************************************************************************
3065 // *****************************************************************************
3066 // *****************************************************************************
3067 /* Function:
3068  bool DRV_TMR_Start ( DRV_HANDLE handle )
3069  Summary:
3070  Starts the Timer counting.
3071  <p><b>Implementation:</b> Static/Dynamic</p>
3072  Description:
3073  This function starts the Timer counting.
3074  Precondition:
3075  The DRV_TMR_Initialize function must have been called.
3076  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3077  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
3078  Parameters:
3079  handle - A valid open-instance handle, returned from the driver's
3080  open routine
3081  Returns:
3082  - true - if the operation succeeded
3083  - false - the supplied handle is invalid or the client doesn't have
3084  the needed parameters to run (alarm callback and period )
3085  Example:
3086  <code>
3087  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3088  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
3089  DRV_TMR_Start ( tmrHandle );
3090  </code>
3091  Remarks:
3092  None.
3093 */
3094 
3095 bool
3096  DRV_TMR_Start (
3097  DRV_HANDLE handle ) ;
3098 // *****************************************************************************
3099 /* Function:
3100  void DRV_TMR_Stop ( DRV_HANDLE handle )
3101  Summary:
3102  Stops the Timer from counting.
3103  <p><b>Implementation:</b> Static/Dynamic</p>
3104  Description:
3105  This function stops the running Timer from counting.
3106  Precondition:
3107  The DRV_TMR_Initialize function must have been called.
3108  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3109  Parameters:
3110  handle - A valid open-instance handle, returned from the driver's
3111  open routine
3112  Returns:
3113  None.
3114  Example:
3115  <code>
3116  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3117  DRV_TMR_Stop ( handle );
3118  </code>
3119  Remarks:
3120  None.
3121 */
3122 
3123 void
3124  DRV_TMR_Stop (
3125  DRV_HANDLE handle ) ;
3126 // *****************************************************************************
3127 // *****************************************************************************
3128 // Section: TMR Driver Operation Status Functions
3129 // *****************************************************************************
3130 // *****************************************************************************
3131 // *****************************************************************************
3132 /* Function:
3133  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
3134  Summary:
3135  Provides the status of Timer's period elapse.
3136  <p><b>Implementation:</b> Dynamic</p>
3137  Description:
3138  This function returns the number of times Timer's period has elapsed since
3139  last call to this API has made. On calling this API, the internally
3140  maintained counter will be cleared and count will be started again from next
3141  elapse.
3142  Precondition:
3143  The DRV_TMR_Initialize function must have been called.
3144  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3145  Parameters:
3146  handle - A valid handle, returned from the DRV_TMR_Open
3147  Returns:
3148  Number of times timer has elapsed since the last call.
3149  Example:
3150  <code>
3151  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3152  bool elapseStatus;
3153  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
3154  unsigned int appInternalTime = 0;
3155  Sys_Tasks()
3156  {
3157  //Timer task will be called from ISR
3158  APP_TimeUpdate_Task();
3159  //Other Tasks
3160  }
3161  void APP_TimeUpdate_Task ( void )
3162  {
3163  //We will not miss a count even though we are late
3164  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
3165  }
3166  </code>
3167  Remarks:
3168  None.
3169 */
3170 
3171 uint32_t
3173  DRV_HANDLE handle ) ;
3174 // *****************************************************************************
3175 // *****************************************************************************
3176 // Section: TMR Driver Control and Information Functions
3177 // *****************************************************************************
3178 // *****************************************************************************
3179 // *****************************************************************************
3180 /* Function:
3181  bool DRV_TMR_ClockSet
3182  (
3183  DRV_HANDLE handle,
3184  DRV_TMR_CLK_SOURCES clockSource,
3185  TMR_PRESCALE preScale
3186  )
3187  Summary:
3188  Sets the timers clock by selecting the source and prescaler.
3189  <p><b>Implementation:</b> Dynamic</p>
3190  Description:
3191  This function sets the timer clock by selecting the source and prescaler.
3192  The clock sources are device specific, refer device datasheet for supported
3193  clock sources. If unsupported clock source is passed then the behaviour of
3194  this function is unpredictable.
3195  Precondition:
3196  The DRV_TMR_Initialize function must have been called. Must have selected
3197  32-Bit timer mode if mode selection is applicable.
3198  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3199  Parameters:
3200  handle - A valid open-instance handle, returned from the driver's
3201  open routine
3202  clockSource - Clock source of the timer
3203  preScale - Timer's Prescaler divisor
3204  Returns:
3205  - true - if the operation is successful
3206  - false - either the handle is invalid or the clockSource
3207  and/or prescaler are not supported
3208  Example:
3209  <code>
3210  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3211  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
3212  </code>
3213  Remarks:
3214  None.
3215 */
3216 
3217 bool
3219  DRV_HANDLE handle ,
3220  DRV_TMR_CLK_SOURCES clockSource ,
3221  TMR_PRESCALE preScale ) ;
3222 // *****************************************************************************
3223 /* Function:
3224  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
3225  Summary:
3226  This function gets the currently selected prescaler.
3227  <p><b>Implementation:</b> Dynamic</p>
3228  Description:
3229  This function gets the currently selected prescaler.
3230  Precondition:
3231  The DRV_TMR_Initialize function must have been called.
3232  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3233  Parameters:
3234  handle - A valid open-instance handle, returned from the driver's
3235  open routine
3236  Returns:
3237  Timer prescaler.
3238  Example:
3239  <code>
3240  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3241  TMR_PRESCALE preScale;
3242  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
3243  </code>
3244  Remarks:
3245  None.
3246 */
3247 
3248 TMR_PRESCALE
3250  DRV_HANDLE handle ) ;
3251 // *****************************************************************************
3252 /* Function:
3253  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
3254  Summary:
3255  This function gets the currently selected operation mode.
3256  <p><b>Implementation:</b> Dynamic</p>
3257  Description:
3258  This function gets the currently selected 16/32 bit operation mode.
3259  Precondition:
3260  The DRV_TMR_Initialize function must have been called.
3261  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3262  Parameters:
3263  handle - A valid open-instance handle, returned from the driver's
3264  open routine
3265  Returns:
3266  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
3267  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
3268  handle.
3269  Example:
3270  <code>
3271  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3272  DRV_TMR_OPERATION_MODE operMode;
3273  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
3274  </code>
3275  Remarks:
3276  None.
3277 */
3278 
3281  DRV_HANDLE handle ) ;
3282 // *****************************************************************************
3283 /* Function:
3284  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
3285  Summary:
3286  Enables the Gate mode.
3287  <p><b>Implementation:</b> Dynamic</p>
3288  Description:
3289  This function enables the Gated mode of Timer. User can measure the duration
3290  of an external signal in this mode. Once the Gate mode is enabled, Timer
3291  will start on the raising edge of the external signal. It will keep counting
3292  until the next falling edge.
3293  Precondition:
3294  The DRV_TMR_Initialize function must have been called.
3295  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3296  Parameters:
3297  handle - A valid open-instance handle, returned from the driver's
3298  open routine
3299  Returns:
3300  - true - if the operation is successful
3301  - false - either the handle is invalid or the gate mode
3302  is not supported
3303  Example:
3304  <code>
3305  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3306  DRV_TMR_GateModeSet ( tmrHandle );
3307  </code>
3308  Remarks:
3309  None.
3310 */
3311 
3312 bool
3314  DRV_HANDLE handle ) ;
3315 // *****************************************************************************
3316 /* Function:
3317  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
3318  Summary:
3319  Enables the Gate mode.
3320  <p><b>Implementation:</b> Dynamic</p>
3321  Description:
3322  This function enables the Gated mode of Timer. User can measure the duration
3323  of an external signal in this mode. Once the Gate mode is enabled, Timer
3324  will start on the raising edge of the external signal. It will keep counting
3325  until the next falling edge.
3326  Precondition:
3327  The DRV_TMR_Initialize function must have been called.
3328  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3329  Parameters:
3330  handle - A valid open-instance handle, returned from the driver's
3331  open routine
3332  Returns:
3333  - true - if the operation is successful
3334  - false - either the handle is invalid or the gate mode
3335  is not supported
3336  Example:
3337  <code>
3338  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3339  DRV_TMR_GateModeClear ( tmrHandle );
3340  </code>
3341  Remarks:
3342  None.
3343 */
3344 
3345 bool
3347  DRV_HANDLE handle ) ;
3348 // *****************************************************************************
3349 /* Function:
3350  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
3351  Summary:
3352  Provides the Timer input frequency.
3353  <p><b>Implementation:</b> Dynamic</p>
3354  Description:
3355  This function provides the Timer input frequency. Input frequency is the
3356  clock to the Timer register and it is considering the prescaler divisor.
3357  Precondition:
3358  The DRV_TMR_Initialize function must have been called.
3359  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3360  Parameters:
3361  handle - A valid open-instance handle, returned from the driver's
3362  open routine
3363  Returns:
3364  32-bit value corresponding to the running frequency.
3365  If Timer clock source is external, then this function returns 0.
3366  Example:
3367  <code>
3368  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3369  uint32_t clkFreqHz;
3370  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3371  </code>
3372  Remarks:
3373  On most processors, the Timer's base frequency is the same as the peripheral
3374  bus clock.
3375 */
3376 
3377 uint32_t
3379  DRV_HANDLE handle ) ;
3380 // *****************************************************************************
3381 /* Function:
3382  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
3383  (
3384  DRV_HANDLE handle,
3385  DRV_TMR_DIVIDER_RANGE* pDivRange
3386  )
3387  Summary:
3388  Returns the Timer divider values.
3389  <p><b>Implementation:</b> Dynamic</p>
3390  Description:
3391  This function provides the Timer operating mode and divider range.
3392  Precondition:
3393  The DRV_TMR_Initialize function must have been called.
3394  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3395  Parameters:
3396  handle - A valid open-instance handle, returned from the driver's
3397  open routine
3398  pDivRange - Address to store the timer divider range.
3399  Returns:
3400  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
3401  The pDivRange is updated with the supported range values.
3402  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
3403  Example:
3404  <code>
3405  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3406  DRV_TMR_OPERATION_MODE timerMode;
3407  DRV_TMR_DIVIDER_RANGE timerRange;
3408  DRV_TMR_DividerRangeGet(handle, &timerRange);
3409  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3410  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
3411  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
3412  </code>
3413  Remarks:
3414  None.
3415 */
3416 
3419  DRV_HANDLE handle ,
3420  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3421 // *****************************************************************************
3422 // *****************************************************************************
3423 // Section: File includes for the APIs which are required for backward
3424 // compatibility.
3425 // *****************************************************************************
3426 // *****************************************************************************
3427 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
3428 /*******************************************************************************
3429  Timer Device Driver Interface Definition
3430  Company:
3431  Microchip Technology Inc.
3432  File Name:
3433  drv_tmr_compatibility.h
3434  Summary:
3435  Timer device driver interface header file.
3436  Description:
3437  This header file contains macro definition for APIs which will be deprecated
3438  later. This header file is included in drv_tmr.h.
3439 *******************************************************************************/
3440 //DOM-IGNORE-BEGIN
3441 /*******************************************************************************
3442 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
3443 Microchip licenses to you the right to use, modify, copy and distribute
3444 Software only when embedded on a Microchip microcontroller or digital signal
3445 controller that is integrated into your product or third party product
3446 (pursuant to the sublicense terms in the accompanying license agreement).
3447 You should refer to the license agreement accompanying this Software for
3448 additional information regarding your rights and obligations.
3449 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
3450 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
3451 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
3452 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
3453 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
3454 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
3455 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
3456 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
3457 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
3458 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
3459 *******************************************************************************/
3460 //DOM-IGNORE-END
3461 #ifndef _DRV_TMR_DEPRECATED_H
3462 #define _DRV_TMR_DEPRECATED_H
3463 // *****************************************************************************
3464 // *****************************************************************************
3465 // Section: File includes
3466 // *****************************************************************************
3467 // *****************************************************************************
3468 // *****************************************************************************
3469 /* Function:
3470  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
3471  Summary:
3472  Maintains the driver's state machine, processes the events and implements
3473  its ISR.
3474  <p><b>Implementation:</b> Dynamic</p>
3475  Description:
3476  This function is used to maintain the driver's internal state machine and
3477  processes the timer events in interrupt-driven implementations
3478  (DRV_TMR_INTERRUPT_MODE == true).
3479  Precondition:
3480  The DRV_TMR_Initialize function must have been called for the specified Timer
3481  driver instance.
3482  Parameters:
3483  object - Object handle for the specified driver instance (returned from
3484  DRV_TMR_Initialize)
3485  Returns:
3486  None
3487  Example:
3488  <code>
3489  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
3490  {
3491  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
3492  }
3493  </code>
3494  Remarks:
3495  This function is normally not called directly by an application.
3496  It is called by the timer driver raw ISR.
3497  This function will execute in an ISR context and will never block or access any
3498  resources that may cause it to block.
3499 
3500  This function will be deprecated later, so avoid using it as much as possible.
3501  Use generic function "DRV_TMR_Tasks" instead of this.
3502 */
3503 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
3504 // *****************************************************************************
3505 /* Function:
3506  void DRV_TMR_CounterValue16BitSet
3507  (
3508  DRV_HANDLE handle,
3509  uint16_t counterPeriod
3510  )
3511  Summary:
3512  Updates the 16-bit Timer's counter register.
3513  <p><b>Implementation:</b> Dynamic</p>
3514  Description:
3515  This function updates the 16-bit Timer's value in the counter register. This
3516  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
3517  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
3518  DRV_TMR_CounterValue32BitSet function.
3519  Precondition:
3520  The DRV_TMR_Initialize function must have been called. Must have selected
3521  16-Bit timer mode if mode selection is applicable.
3522  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3523  Parameters:
3524  handle - A valid open-instance handle, returned from the driver's
3525  open routine
3526  counterPeriod - 16-bit counter period value
3527  Returns:
3528  None.
3529  Example:
3530  <code>
3531  //Example to use timer for precision time measurement
3532  //without configuring an alarm (interrupt based)
3533  char appState = 0;
3534  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3535 
3536  switch ( appState )
3537  {
3538  case 0:
3539  //Calculate and set the counter period
3540  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3541 
3542  //counter starts
3543  DRV_TMR_Start ( tmrHandle );
3544 
3545  //Trigger an application operation
3546  app_trigger_operation();
3547 
3548  //Check for time-out in the next state
3549  appState++;
3550  case 1:
3551  //Overflows and stops at 0 if no alarm is set
3552  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3553  {
3554  //Time-out
3555  return false;
3556  }
3557  else if ( app_operation_isComplete( ) )
3558  {
3559  //Operation is complete before time-out
3560  return true;
3561  }
3562  </code>
3563  Remarks:
3564  This function will be deprecated later, so avoid using it as much as possible.
3565  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3566 */
3567 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3568 // *****************************************************************************
3569 /* Function:
3570  void DRV_TMR_CounterValue32BitSet
3571  (
3572  DRV_HANDLE handle,
3573  uint32_t counterPeriod
3574  )
3575  Summary:
3576  Updates the 32-bit Timer's counter register.
3577  <p><b>Implementation:</b> Dynamic</p>
3578  Description:
3579  This function updates the 32-bit Timer's value in the counter register. This
3580  is valid only if the 32-bit mode of the timer is selected Otherwise use
3581  DRV_TMR_CounterValue16BitSet function.
3582  Precondition:
3583  The DRV_TMR_Initialize function must have been called. Must have selected
3584  32-Bit timer mode.
3585  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3586  Parameters:
3587  handle - A valid open-instance handle, returned from the driver's
3588  open routine
3589  counterPeriod - 32-bit counter period value
3590  Returns:
3591  None.
3592  Example:
3593  <code>
3594  //Example to use timer for precision time measurement
3595  //without configuring an alarm (interrupt based)
3596  char appState = 0;
3597  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3598 
3599  switch ( appState )
3600  {
3601  case 0:
3602  //Calculate and set the counter period
3603  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3604 
3605  //counter starts
3606  DRV_TMR_Start ( tmrHandle );
3607 
3608  //Trigger an application operation against which we want to use the time-out
3609  app_trigger_operation();
3610 
3611  //Check for time-out in the next state
3612  appState++;
3613  case 1:
3614  //Overflows and stops at 0 if no alarm is set
3615  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3616  {
3617  //Time-out
3618  return false;
3619  }
3620  else if ( app_operation_isComplete( ) )
3621  {
3622  //Operation is complete before time-out
3623  return true;
3624  }
3625  </code>
3626  Remarks:
3627  In most of the devices only even numbered instances of timer supports
3628  32-bit mode.
3629  This function will be deprecated later, so avoid using it as much as possible.
3630  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3631 */
3632 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3633 // *****************************************************************************
3634 /* Function:
3635  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3636  Summary:
3637  Reads the 16-bit Timer's counter register.
3638  <p><b>Implementation:</b> Dynamic</p>
3639  Description:
3640  This function returns the 16-bit Timer's value in the counter register. This
3641  is valid only if the 16-bit mode of the timer is selected.
3642  Otherwise use DRV_TMR_CounterValue32BitGet function.
3643  Precondition:
3644  The DRV_TMR_Initialize function must have been called. Must have selected
3645  16-Bit timer mode if mode selection is applicable.
3646  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3647  Parameters:
3648  handle - A valid open-instance handle, returned from the driver's
3649  open routine
3650 
3651  Returns:
3652  Timer period in 16-bit mode.
3653  Example:
3654  <code>
3655  //Example to use timer for precision time measurement
3656  //without configuring an alarm (interrupt based)
3657  char appState = 0;
3658  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3659 
3660  switch ( appState )
3661  {
3662  case 0:
3663  //Calculate and set the counter period
3664  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3665 
3666  //counter starts
3667  DRV_TMR_Start ( tmrHandle );
3668 
3669  //Trigger an application operation
3670  app_trigger_operation();
3671 
3672  //Check for time-out in the next state
3673  appState++;
3674  case 1:
3675  //Overflows and stops at 0 if no alarm is set
3676  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3677  {
3678  //Time-out
3679  return false;
3680  }
3681  else if ( app_operation_isComplete( ) )
3682  {
3683  //Operation is complete before time-out
3684  return true;
3685  }
3686  </code>
3687  Remarks:
3688  This function will be deprecated later, so avoid using it as much as possible.
3689  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3690 */
3691 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3692 // *****************************************************************************
3693 /* Function:
3694  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3695  Summary:
3696  Reads the 32-bit Timer's counter register.
3697  <p><b>Implementation:</b> Dynamic</p>
3698  Description:
3699  This function returns the 32-bit Timer's value in the counter register. This
3700  is valid only if the 32-bit mode of the timer is selected Otherwise use
3701  DRV_TMR_CounterValue16BitGet function.
3702  Precondition:
3703  The DRV_TMR_Initialize function must have been called. Must have selected
3704  32-Bit timer mode.
3705  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3706  Parameters:
3707  handle - A valid open-instance handle, returned from the driver's
3708  open routine
3709 
3710  Returns:
3711  32-Bit Counter value.
3712  Example:
3713  <code>
3714  //Example to use timer for precision time measurement
3715  //without configuring an alarm (interrupt based)
3716  char appState = 0;
3717  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3718 
3719  switch ( appState )
3720  {
3721  case 0:
3722  //Calculate and set the counter period
3723  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3724 
3725  //counter starts
3726  DRV_TMR_Start ( tmrHandle );
3727 
3728  //Trigger an application operation
3729  app_trigger_operation();
3730 
3731  //Check for time-out in the next state
3732  appState++;
3733  case 1:
3734  //Overflows and stops at 0 if no alarm is set
3735  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3736  {
3737  //Time-out
3738  return false;
3739  }
3740  else if ( app_operation_isComplete( ) )
3741  {
3742  //Operation is complete before time-out
3743  return true;
3744  }
3745  </code>
3746  Remarks:
3747  In most of the devices only even numbered instances of timer supports
3748  32-bit mode.
3749  This function will be deprecated later, so avoid using it as much as possible.
3750  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3751 */
3752 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3753 // *****************************************************************************
3754 /* Function:
3755  void DRV_TMR_Alarm16BitRegister
3756  (
3757  DRV_HANDLE handle,
3758  uint16_t period,
3759  bool isPeriodic,
3760  uintptr_t context,
3761  DRV_TMR_CALLBACK callBack
3762  )
3763  Summary:
3764  Sets up an alarm.
3765  <p><b>Implementation:</b> Dynamic</p>
3766  Description:
3767  This function sets up an alarm, allowing the client to receive a callback
3768  from the driver when the counter period elapses. Alarms can be one-shot or
3769  periodic. This API is valid only if the 16-bit mode of the timer is
3770  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3771  Precondition:
3772  The DRV_TMR_Initialize function must have been called. Must have selected
3773  16-Bit timer mode if mode selection is applicable.
3774  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3775  Parameters:
3776  handle - A valid handle, returned from DRV_TMR_Open
3777  period - 16-bit period which will be loaded into the Timer hardware register.
3778 
3779  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3780 
3781  context - A reference, call back function will be called with the same
3782  reference.
3783 
3784  callBack - A call back function which will be called on period elapse.
3785 
3786  Returns:
3787  None
3788  Example:
3789  <code>
3790  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3791 
3792  void setupTask ()
3793  {
3794  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3795 
3796  // Calculate the count to be passed on from the clock input
3797  //Periodically toggle LED
3798  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3799  ToggleLedCallBack );
3800  }
3801 
3802  void ToggleLedCallBack ( uintptr_t context )
3803  {
3804  //Toggle
3805  }
3806  </code>
3807  Remarks:
3808  This function will be deprecated later, so avoid using it as much as possible.
3809  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3810 */
3811 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3812 // *****************************************************************************
3813 /* Function:
3814  void DRV_TMR_Alarm32BitRegister
3815  (
3816  DRV_HANDLE handle,
3817  uint32_t period,
3818  bool isPeriodic,
3819  uintptr_t context,
3820  DRV_TMR_CALLBACK callBack
3821  )
3822  Summary:
3823  Sets up an alarm.
3824  <p><b>Implementation:</b> Dynamic</p>
3825  Description:
3826  This function sets up an alarm, allowing the client to receive a callback
3827  from the driver when the counter period elapses. Alarms can be one-shot or
3828  periodic. This API is valid only if the 32-bit mode of the timer is
3829  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3830  Precondition:
3831  The DRV_TMR_Initialize function must have been called. Must have selected
3832  32-Bit timer mode.
3833  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3834  Parameters:
3835  handle - A valid handle, returned from DRV_TMR_Open
3836  period - 32-bit period which will be loaded into the Timer hardware register.
3837 
3838  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3839 
3840  context - A reference, call back function will be called with the same
3841  reference.
3842 
3843  callBack - A call back function which will be called on period elapse.
3844 
3845  Returns:
3846  None
3847  Example:
3848  <code>
3849  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3850 
3851  void setupTask ()
3852  {
3853  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3854 
3855  // Calculate the count to be passed on from the clock input
3856  //Periodically toggle LED
3857  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3858  ToggleLedCallBack );
3859  }
3860 
3861  void ToggleLedCallBack ( uintptr_t context )
3862  {
3863  //Toggle
3864  }
3865  </code>
3866  Remarks:
3867  In most of the devices only even numbered instances of timer supports
3868  32-bit mode.
3869  This function will be deprecated later, so avoid using it as much as possible.
3870  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3871 */
3872 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3873 // *****************************************************************************
3874 /* Function:
3875  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3876  Summary:
3877  Updates the 16-bit Timer's period.
3878  <p><b>Implementation:</b> Dynamic</p>
3879  Description:
3880  This function updates the 16-bit Timer's period. This API is valid only if
3881  the 16-bit mode of the timer is selected
3882  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3883  Precondition:
3884  The DRV_TMR_Initialize function must have been called. Must have selected
3885  16-Bit timer mode if mode selection is applicable.
3886  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3887  Parameters:
3888  handle - A valid open-instance handle, returned from the driver's
3889  open routine
3890  value - 16-bit Period value
3891  Returns:
3892  None.
3893  Example:
3894  <code>
3895  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3896  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3897  </code>
3898  Remarks:
3899  This function will be deprecated later, so avoid using it as much as possible.
3900  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3901 */
3902 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3903 // *****************************************************************************
3904 /* Function:
3905  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3906  Summary:
3907  Updates the 32-bit Timer's period.
3908  <p><b>Implementation:</b> Dynamic</p>
3909  Description:
3910  This function updates the 32-bit Timer's period. This API is valid only if
3911  the 32-bit mode of the timer is selected
3912  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3913  Precondition:
3914  The DRV_TMR_Initialize unction must have been called. Must have selected
3915  32-Bit timer mode.
3916  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3917  Parameters:
3918  handle - A valid open-instance handle, returned from the driver's
3919  open routine
3920  period - 32-bit Period value
3921  Returns:
3922  None.
3923  Example:
3924  <code>
3925  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3926  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3927  </code>
3928  Remarks:
3929  In most of the devices only even numbered instances of timer supports
3930  32-bit mode.
3931  This function will be deprecated later, so avoid using it as much as possible.
3932  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3933 */
3934 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3935 // *****************************************************************************
3936 /* Function:
3937  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3938  Summary:
3939  Provides the 16-bit Timer's period.
3940  <p><b>Implementation:</b> Dynamic</p>
3941  Description:
3942  This function gets the 16-bit Timer's period. This API is valid only if
3943  the 16-bit mode of the timer is selected.
3944  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3945  Precondition:
3946  The DRV_TMR_Initialize function must have been called. Must have selected
3947  16-Bit timer mode if mode selection is applicable.
3948  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3949  Parameters:
3950  handle - A valid open-instance handle, returned from the driver's
3951  open routine
3952  Returns:
3953  16-bit timer period value
3954  Example:
3955  <code>
3956  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3957  uint16_t period;
3958 
3959  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3960  </code>
3961  Remarks:
3962  This function will be deprecated later, so avoid using it as much as possible.
3963  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3964 */
3965 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3966 // *****************************************************************************
3967 /* Function:
3968  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3969  Summary:
3970  Provides the 32-bit Timer's period.
3971  <p><b>Implementation:</b> Dynamic</p>
3972  Description:
3973  This function gets the 32-bit Timer's period. This API is valid only if
3974  the 32-bit mode of the timer is selected
3975  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3976  Precondition:
3977  The DRV_TMR_Initialize function must have been called. Must have selected
3978  32-Bit timer mode.
3979  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3980  Parameters:
3981  handle - A valid open-instance handle, returned from the driver's
3982  open routine
3983  Returns:
3984  32-bit Timer period value.
3985  Example:
3986  <code>
3987  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3988  uint32_t period;
3989  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3990  </code>
3991  Remarks:
3992  In most of the devices only even numbered instances of timer supports
3993  32-bit mode.
3994  This function will be deprecated later, so avoid using it as much as possible.
3995  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3996 */
3997 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3998 // *****************************************************************************
3999 /* Function:
4000  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
4001  Summary:
4002  Removes a previously set alarm.
4003  <p><b>Implementation:</b> Dynamic</p>
4004  Description:
4005  This function removes a previously set alarm. This API is valid only if
4006  the 16-bit mode of the timer is selected
4007  Otherwise use DRV_TMR_Alarm32BitDeregister function.
4008  Precondition:
4009  The DRV_TMR_Initialize function must have been called. Must have selected
4010  16-Bit timer mode if mode selection is applicable.
4011  DRV_TMR_Open must have been called to obtain a valid opened device handle.
4012 
4013  DRV_TMR_Alarm16BitRegister function must have been called before.
4014  Parameters:
4015  handle - A valid open-instance handle, returned from the driver's
4016  open routine
4017  Returns:
4018  None.
4019  Example:
4020  <code>
4021  //Example of a key debounce check
4022 
4023  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
4024  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
4025  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
4026 
4027  void keyPressDetect ()
4028  {
4029  // Calculate the count to be passed on from the clock input
4030  //Periodically toggle LED
4031  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
4032  DebounceCheck );
4033  }
4034 
4035  void DebounceCheck ( uintptr_t context )
4036  {
4037  readKey = AppReadKey();
4038 
4039  if ( readKey != lastReadKey )
4040  {
4041  lastReadKey = readKey;
4042  keyCount = 0;
4043  }
4044  else
4045  {
4046  if ( keyCount > 20 )
4047  {
4048  globalKeyState = readKey;
4049  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
4050  }
4051  keyCount++;
4052  }
4053  }
4054  </code>
4055  Remarks:
4056  This function will be deprecated later, so avoid using it as much as possible.
4057  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
4058 */
4059 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
4060 // *****************************************************************************
4061 /* Function:
4062  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
4063  Summary:
4064  Removes a previously set alarm.
4065  <p><b>Implementation:</b> Dynamic</p>
4066  Description:
4067  This function removes a previously set alarm. This API is valid only if
4068  the 32-bit mode of the timer is selected
4069  Otherwise use DRV_TMR_Alarm16BitDeregister function.
4070  Precondition:
4071  The DRV_TMR_Initialize function must have been called. Must have selected
4072  32-Bit timer mode if mode selection is applicable.
4073  DRV_TMR_Open must have been called to obtain a valid opened device handle.
4074 
4075  DRV_TMR_Alarm32BitRegister function must have been called before.
4076  Parameters:
4077  handle - A valid open-instance handle, returned from the driver's
4078  open routine
4079  Returns:
4080  None.
4081  Example:
4082  <code>
4083  //Example of a key debounce check
4084 
4085  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
4086  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
4087  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
4088 
4089  void keyPressDetect ( void )
4090  {
4091  // Calculate the count to be passed on from the clock input
4092  //Periodically check the key status
4093  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
4094  DebounceCheck );
4095  }
4096 
4097  void DebounceCheck ( uintptr_t context )
4098  {
4099  readKey = AppReadKey();
4100 
4101  if ( readKey != lastReadKey )
4102  {
4103  lastReadKey = readKey;
4104  keyCount = 0;
4105  }
4106  else
4107  {
4108  if ( keyCount > 20 )
4109  {
4110  //Key is stable now
4111  globalKeyState = readKey;
4112  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
4113  }
4114  keyCount++;
4115  }
4116  }
4117  </code>
4118  Remarks:
4119  In most of the devices only even numbered instances of timer supports
4120  32-bit mode.
4121  This function will be deprecated later, so avoid using it as much as possible.
4122  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
4123 */
4124 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
4125  // #ifndef _DRV_TMR_DEPRECATED_H
4126 /*******************************************************************************
4127  End of File
4128 */
4129 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
4130 /* CLOSE_FILE Include File */
4131 
4132 //DOM-IGNORE-BEGIN
4133 //DOM-IGNORE-END
4134  // #ifndef _DRV_TMR_H
4135 /*******************************************************************************
4136  End of File
4137 */
4138 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
4139 /* CLOSE_FILE Include File */
4140 
4141 #include "peripheral/tmr/plib_tmr.h"
4142 #include "peripheral/int/plib_int.h"
4143 // maximum divider value for 32 bit operation mode
4144 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
4145 // minimum divider value for 32 bit operation mode
4146 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
4147 // maximum divider value for 16 bit operation mode
4148 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
4149 // minimum divider value for 16 bit operation mode
4150 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
4151 // *****************************************************************************
4152 // *****************************************************************************
4153 // Section: Interface Headers for Instance 0 for the static driver
4154 // *****************************************************************************
4155 // *****************************************************************************
4156 
4157 void
4158  DRV_TMR0_Initialize ( void ) ;
4159 
4160 bool
4161  DRV_TMR0_Start ( void ) ;
4162 
4163 void
4164  DRV_TMR0_Stop ( void ) ;
4165 
4166 static inline void
4168  {
4169  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
4170  DRV_TMR0_Stop () ;
4171  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
4172  statusst_58zqendz ( 2 ) ; /* 30 */
4173  }
4174 
4175 static inline SYS_STATUS
4177 {
4178  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
4179  /* Return the status as ready always */
4180  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
4181  statusst_58zqendz ( 4 ) ; /* 30 */
4182  return
4183  SYS_STATUS_READY ;
4184 }
4185 
4186 static inline void
4187  DRV_TMR0_Open ( void )
4188  {
4189  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
4190  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
4191  statusst_58zqendz ( 6 ) ; /* 30 */
4192  }
4193 
4195  DRV_TMR0_ClientStatus ( void ) ;
4196 
4197 static inline DRV_TMR_OPERATION_MODE
4199 {
4200  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
4201  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
4202  statusst_58zqendz ( 8 ) ; /* 30 */
4203  return
4205 }
4206 
4207 static inline void
4209  {
4210  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
4211  DRV_TMR0_Stop () ;
4212  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
4213  statusst_58zqendz ( 10 ) ; /* 30 */
4214  }
4215 
4216 bool
4218  DRV_TMR_CLK_SOURCES clockSource ,
4219  TMR_PRESCALE prescale ) ;
4220 
4221 void
4223  uint32_t value ) ;
4224 
4225 uint32_t
4226  DRV_TMR0_CounterValueGet ( void ) ;
4227 
4228 void
4229  DRV_TMR0_CounterClear ( void ) ;
4230 
4231 TMR_PRESCALE
4232  DRV_TMR0_PrescalerGet ( void ) ;
4233 
4234 void
4236  uint32_t value ) ;
4237 
4238 uint32_t
4239  DRV_TMR0_PeriodValueGet ( void ) ;
4240 
4241 void
4242  DRV_TMR0_StopInIdleDisable ( void ) ;
4243 
4244 void
4245  DRV_TMR0_StopInIdleEnable ( void ) ;
4246 
4247 static inline void
4249  {
4250  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
4251  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
4252  statusst_58zqendz ( 12 ) ; /* 30 */
4253  }
4254 
4255 uint32_t
4256  DRV_TMR0_CounterFrequencyGet ( void ) ;
4257 
4260  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4261 // *****************************************************************************
4262 // *****************************************************************************
4263 // Section: Interface Headers for Instance 1 for the static driver
4264 // *****************************************************************************
4265 // *****************************************************************************
4266 
4267 void
4268  DRV_TMR1_Initialize ( void ) ;
4269 
4270 bool
4271  DRV_TMR1_Start ( void ) ;
4272 
4273 void
4274  DRV_TMR1_Stop ( void ) ;
4275 
4276 static inline void
4278  {
4279  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
4280  DRV_TMR1_Stop () ;
4281  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
4282  statusst_58zqendz ( 14 ) ; /* 30 */
4283  }
4284 
4285 static inline SYS_STATUS
4287 {
4288  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
4289  /* Return the status as ready always */
4290  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
4291  statusst_58zqendz ( 16 ) ; /* 30 */
4292  return
4293  SYS_STATUS_READY ;
4294 }
4295 
4296 static inline void
4297  DRV_TMR1_Open ( void )
4298  {
4299  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
4300  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
4301  statusst_58zqendz ( 18 ) ; /* 30 */
4302  }
4303 
4305  DRV_TMR1_ClientStatus ( void ) ;
4306 
4307 static inline DRV_TMR_OPERATION_MODE
4309 {
4310  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
4311  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
4312  statusst_58zqendz ( 20 ) ; /* 30 */
4313  return
4315 }
4316 
4317 static inline void
4319  {
4320  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
4321  DRV_TMR1_Stop () ;
4322  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
4323  statusst_58zqendz ( 22 ) ; /* 30 */
4324  }
4325 
4326 bool
4328  DRV_TMR_CLK_SOURCES clockSource ,
4329  TMR_PRESCALE prescale ) ;
4330 
4331 void
4333  uint32_t value ) ;
4334 
4335 uint32_t
4336  DRV_TMR1_CounterValueGet ( void ) ;
4337 
4338 void
4339  DRV_TMR1_CounterClear ( void ) ;
4340 
4341 TMR_PRESCALE
4342  DRV_TMR1_PrescalerGet ( void ) ;
4343 
4344 void
4346  uint32_t value ) ;
4347 
4348 uint32_t
4349  DRV_TMR1_PeriodValueGet ( void ) ;
4350 
4351 void
4352  DRV_TMR1_StopInIdleDisable ( void ) ;
4353 
4354 void
4355  DRV_TMR1_StopInIdleEnable ( void ) ;
4356 
4357 static inline void
4359  {
4360  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
4361  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
4362  statusst_58zqendz ( 24 ) ; /* 30 */
4363  }
4364 
4365 uint32_t
4366  DRV_TMR1_CounterFrequencyGet ( void ) ;
4367 
4370  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4371 // *****************************************************************************
4372 // *****************************************************************************
4373 // Section: Interface Headers for Instance 2 for the static driver
4374 // *****************************************************************************
4375 // *****************************************************************************
4376 
4377 void
4378  DRV_TMR2_Initialize ( void ) ;
4379 
4380 bool
4381  DRV_TMR2_Start ( void ) ;
4382 
4383 void
4384  DRV_TMR2_Stop ( void ) ;
4385 
4386 static inline void
4388  {
4389  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
4390  DRV_TMR2_Stop () ;
4391  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
4392  statusst_58zqendz ( 26 ) ; /* 30 */
4393  }
4394 
4395 static inline SYS_STATUS
4397 {
4398  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
4399  /* Return the status as ready always */
4400  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
4401  statusst_58zqendz ( 28 ) ; /* 30 */
4402  return
4403  SYS_STATUS_READY ;
4404 }
4405 
4406 static inline void
4407  DRV_TMR2_Open ( void )
4408  {
4409  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
4410  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
4411  statusst_58zqendz ( 30 ) ; /* 30 */
4412  }
4413 
4415  DRV_TMR2_ClientStatus ( void ) ;
4416 
4417 static inline DRV_TMR_OPERATION_MODE
4419 {
4420  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
4421  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
4422  statusst_58zqendz ( 32 ) ; /* 30 */
4423  return
4425 }
4426 
4427 static inline void
4429  {
4430  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
4431  DRV_TMR2_Stop () ;
4432  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
4433  statusst_58zqendz ( 34 ) ; /* 30 */
4434  }
4435 
4436 bool
4438  DRV_TMR_CLK_SOURCES clockSource ,
4439  TMR_PRESCALE prescale ) ;
4440 
4441 void
4443  uint32_t value ) ;
4444 
4445 uint32_t
4446  DRV_TMR2_CounterValueGet ( void ) ;
4447 
4448 void
4449  DRV_TMR2_CounterClear ( void ) ;
4450 
4451 TMR_PRESCALE
4452  DRV_TMR2_PrescalerGet ( void ) ;
4453 
4454 void
4456  uint32_t value ) ;
4457 
4458 uint32_t
4459  DRV_TMR2_PeriodValueGet ( void ) ;
4460 
4461 void
4462  DRV_TMR2_StopInIdleDisable ( void ) ;
4463 
4464 void
4465  DRV_TMR2_StopInIdleEnable ( void ) ;
4466 
4467 static inline void
4469  {
4470  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
4471  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
4472  statusst_58zqendz ( 36 ) ; /* 30 */
4473  }
4474 
4475 uint32_t
4476  DRV_TMR2_CounterFrequencyGet ( void ) ;
4477 
4480  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4481 // *****************************************************************************
4482 // *****************************************************************************
4483 // Section: Interface Headers for Instance 3 for the static driver
4484 // *****************************************************************************
4485 // *****************************************************************************
4486 
4487 void
4488  DRV_TMR3_Initialize ( void ) ;
4489 
4490 bool
4491  DRV_TMR3_Start ( void ) ;
4492 
4493 void
4494  DRV_TMR3_Stop ( void ) ;
4495 
4496 static inline void
4498  {
4499  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
4500  DRV_TMR3_Stop () ;
4501  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
4502  statusst_58zqendz ( 38 ) ; /* 30 */
4503  }
4504 
4505 static inline SYS_STATUS
4507 {
4508  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
4509  /* Return the status as ready always */
4510  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
4511  statusst_58zqendz ( 40 ) ; /* 30 */
4512  return
4513  SYS_STATUS_READY ;
4514 }
4515 
4516 static inline void
4517  DRV_TMR3_Open ( void )
4518  {
4519  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
4520  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
4521  statusst_58zqendz ( 42 ) ; /* 30 */
4522  }
4523 
4525  DRV_TMR3_ClientStatus ( void ) ;
4526 
4527 static inline DRV_TMR_OPERATION_MODE
4529 {
4530  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
4531  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
4532  statusst_58zqendz ( 44 ) ; /* 30 */
4533  return
4535 }
4536 
4537 static inline void
4539  {
4540  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
4541  DRV_TMR3_Stop () ;
4542  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
4543  statusst_58zqendz ( 46 ) ; /* 30 */
4544  }
4545 
4546 bool
4548  DRV_TMR_CLK_SOURCES clockSource ,
4549  TMR_PRESCALE prescale ) ;
4550 
4551 void
4553  uint32_t value ) ;
4554 
4555 uint32_t
4556  DRV_TMR3_CounterValueGet ( void ) ;
4557 
4558 void
4559  DRV_TMR3_CounterClear ( void ) ;
4560 
4561 TMR_PRESCALE
4562  DRV_TMR3_PrescalerGet ( void ) ;
4563 
4564 void
4566  uint32_t value ) ;
4567 
4568 uint32_t
4569  DRV_TMR3_PeriodValueGet ( void ) ;
4570 
4571 void
4572  DRV_TMR3_StopInIdleDisable ( void ) ;
4573 
4574 void
4575  DRV_TMR3_StopInIdleEnable ( void ) ;
4576 
4577 static inline void
4579  {
4580  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4581  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4582  statusst_58zqendz ( 48 ) ; /* 30 */
4583  }
4584 
4585 uint32_t
4586  DRV_TMR3_CounterFrequencyGet ( void ) ;
4587 
4590  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4591 // *****************************************************************************
4592 // *****************************************************************************
4593 // Section: Interface Headers for Instance 4 for the static driver
4594 // *****************************************************************************
4595 // *****************************************************************************
4596 
4597 void
4598  DRV_TMR4_Initialize ( void ) ;
4599 
4600 bool
4601  DRV_TMR4_Start ( void ) ;
4602 
4603 void
4604  DRV_TMR4_Stop ( void ) ;
4605 
4606 static inline void
4608  {
4609  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4610  DRV_TMR4_Stop () ;
4611  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4612  statusst_58zqendz ( 50 ) ; /* 30 */
4613  }
4614 
4615 static inline SYS_STATUS
4617 {
4618  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4619  /* Return the status as ready always */
4620  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4621  statusst_58zqendz ( 52 ) ; /* 30 */
4622  return
4623  SYS_STATUS_READY ;
4624 }
4625 
4626 static inline void
4627  DRV_TMR4_Open ( void )
4628  {
4629  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4630  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4631  statusst_58zqendz ( 54 ) ; /* 30 */
4632  }
4633 
4635  DRV_TMR4_ClientStatus ( void ) ;
4636 
4637 static inline DRV_TMR_OPERATION_MODE
4639 {
4640  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4641  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4642  statusst_58zqendz ( 56 ) ; /* 30 */
4643  return
4645 }
4646 
4647 static inline void
4649  {
4650  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4651  DRV_TMR4_Stop () ;
4652  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4653  statusst_58zqendz ( 58 ) ; /* 30 */
4654  }
4655 
4656 bool
4658  DRV_TMR_CLK_SOURCES clockSource ,
4659  TMR_PRESCALE prescale ) ;
4660 
4661 void
4663  uint32_t value ) ;
4664 
4665 uint32_t
4666  DRV_TMR4_CounterValueGet ( void ) ;
4667 
4668 void
4669  DRV_TMR4_CounterClear ( void ) ;
4670 
4671 TMR_PRESCALE
4672  DRV_TMR4_PrescalerGet ( void ) ;
4673 
4674 void
4676  uint32_t value ) ;
4677 
4678 uint32_t
4679  DRV_TMR4_PeriodValueGet ( void ) ;
4680 
4681 void
4682  DRV_TMR4_StopInIdleDisable ( void ) ;
4683 
4684 void
4685  DRV_TMR4_StopInIdleEnable ( void ) ;
4686 
4687 static inline void
4689  {
4690  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4691  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4692  statusst_58zqendz ( 60 ) ; /* 30 */
4693  }
4694 
4695 uint32_t
4696  DRV_TMR4_CounterFrequencyGet ( void ) ;
4697 
4700  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4701  // #ifndef _DRV_TMR_STATIC_H
4702 /*******************************************************************************
4703  End of File
4704 */
4705 
4706 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4707 /* CLOSE_FILE Include File */
4708 
4709 #include "peripheral/int/plib_int.h"
4710 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4711 /*******************************************************************************
4712  PMP Driver Interface Declarations for Static Single Instance Driver
4713  Company:
4714  Microchip Technology Inc.
4715  File Name:
4716  drv_pmp_static.h
4717  Summary:
4718  PMP driver interface declarations for the static single instance driver.
4719  Description:
4720  The PMP device driver provides a simple interface to manage the PMP
4721  modules on Microchip microcontrollers. This file defines the interface
4722  Declarations for the PMP driver.
4723 
4724  Remarks:
4725  Static interfaces incorporate the driver instance number within the names
4726  of the routines, eliminating the need for an object ID or object handle.
4727 
4728  Static single-open interfaces also eliminate the need for the open handle.
4729 *******************************************************************************/
4730 //DOM-IGNORE-BEGIN
4731 /*******************************************************************************
4732 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4733 Microchip licenses to you the right to use, modify, copy and distribute
4734 Software only when embedded on a Microchip microcontroller or digital signal
4735 controller that is integrated into your product or third party product
4736 (pursuant to the sublicense terms in the accompanying license agreement).
4737 You should refer to the license agreement accompanying this Software for
4738 additional information regarding your rights and obligations.
4739 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4740 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4741 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4742 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4743 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4744 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4745 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4746 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4747 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4748 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4749 *******************************************************************************/
4750 //DOM-IGNORE-END
4751 #ifndef _DRV_PMP_STATIC_H
4752 #define _DRV_PMP_STATIC_H
4753 #include "peripheral/pmp/plib_pmp.h"
4754 // *****************************************************************************
4755 // *****************************************************************************
4756 // Section: Interface Headers for Instance 0 for the static driver
4757 // *****************************************************************************
4758 // *****************************************************************************
4759 
4760 void
4761  DRV_PMP0_Initialize ( void ) ;
4762 
4763 void
4764  DRV_PMP0_ModeConfig ( void ) ;
4765 
4766 void
4768  PMP_DATA_WAIT_STATES dataWait ,
4769  PMP_STROBE_WAIT_STATES strobeWait ,
4770  PMP_DATA_HOLD_STATES dataHold ) ;
4771 
4772 uint8_t
4773  DRV_PMP0_Read ( void ) ;
4774 
4775 void
4776  DRV_PMP0_Write (
4777  uint8_t data ) ;
4778  // #ifndef _DRV_PMP_STATIC_H
4779 /*******************************************************************************
4780  End of File
4781 */
4782 
4783 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4784 /* CLOSE_FILE Include File */
4785 
4786 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4787 /*******************************************************************************
4788  USART Driver Interface Declarations for Static Single Instance Driver
4789  Company:
4790  Microchip Technology Inc.
4791  File Name:
4792  drv_usart_static.h
4793  Summary:
4794  USART driver interface declarations for the static single instance driver.
4795  Description:
4796  The USART device driver provides a simple interface to manage the USART
4797  modules on Microchip microcontrollers. This file defines the interface
4798  Declarations for the USART static driver.
4799  Remarks:
4800  Static interfaces incorporate the driver instance number within the names
4801  of the routines, eliminating the need for an object ID or object handle.
4802  Static single-open interfaces also eliminate the need for the open handle.
4803 *******************************************************************************/
4804 //DOM-IGNORE-BEGIN
4805 /*******************************************************************************
4806 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4807 Microchip licenses to you the right to use, modify, copy and distribute
4808 Software only when embedded on a Microchip microcontroller or digital signal
4809 controller that is integrated into your product or third party product
4810 (pursuant to the sublicense terms in the accompanying license agreement).
4811 You should refer to the license agreement accompanying this Software for
4812 additional information regarding your rights and obligations.
4813 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4814 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4815 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4816 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4817 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4818 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4819 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4820 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4821 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4822 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4823 *******************************************************************************/
4824 //DOM-IGNORE-END
4825 #ifndef _DRV_USART_STATIC_H
4826 #define _DRV_USART_STATIC_H
4827 // *****************************************************************************
4828 // *****************************************************************************
4829 // Section: Included Files
4830 // *****************************************************************************
4831 // *****************************************************************************
4832 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4833 /*******************************************************************************
4834  USART Driver Local Data Structures for static implementation
4835  Company:
4836  Microchip Technology Inc.
4837  File Name:
4838  drv_usart_static_local.h
4839  Summary:
4840  USART Driver Local Data Structures for static implementation
4841  Description:
4842  Driver Local Data Structures for static implementation
4843 *******************************************************************************/
4844 //DOM-IGNORE-BEGIN
4845 /*******************************************************************************
4846 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4847 Microchip licenses to you the right to use, modify, copy and distribute Software
4848 only when embedded on a Microchip microcontroller or digital signal controller
4849 that is integrated into your product or third party product (pursuant to the
4850 sublicense terms in the accompanying license agreement).
4851 You should refer to the license agreement accompanying this Software for
4852 additional information regarding your rights and obligations.
4853 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4854 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4855 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4856 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4857 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4858 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4859 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4860 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4861 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4862 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4863 *******************************************************************************/
4864 //DOM-IGNORE-END
4865 #ifndef _DRV_USART_STATIC_LOCAL_H
4866 #define _DRV_USART_STATIC_LOCAL_H
4867 // *****************************************************************************
4868 // *****************************************************************************
4869 // Section: Included Files
4870 // *****************************************************************************
4871 // *****************************************************************************
4872 #include <stdint.h>
4873 #include <stdbool.h>
4874 #include <stddef.h>
4875 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4876 /*******************************************************************************
4877  USART Driver Interface Header File
4878  Company:
4879  Microchip Technology Inc.
4880  File Name:
4881  drv_usart.h
4882  Summary:
4883  USART Driver Interface Header File
4884  Description:
4885  The USART device driver provides a simple interface to manage the USART or
4886  UART modules on Microchip microcontrollers. This file provides the
4887  interface definition for the USART driver.
4888 *******************************************************************************/
4889 //DOM-IGNORE-BEGIN
4890 /*******************************************************************************
4891 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4892 Microchip licenses to you the right to use, modify, copy and distribute
4893 Software only when embedded on a Microchip microcontroller or digital signal
4894 controller that is integrated into your product or third party product
4895 (pursuant to the sublicense terms in the accompanying license agreement).
4896 You should refer to the license agreement accompanying this Software for
4897 additional information regarding your rights and obligations.
4898 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4899 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4900 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4901 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4902 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4903 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4904 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4905 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4906 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4907 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4908 *******************************************************************************/
4909 //DOM-IGNORE-END
4910 #ifndef _DRV_USART_H
4911 #define _DRV_USART_H
4912 // *****************************************************************************
4913 // *****************************************************************************
4914 // Section: File includes
4915 // *****************************************************************************
4916 // *****************************************************************************
4917 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4918 /*******************************************************************************
4919  USART Driver Definitions Header File
4920  Company:
4921  Microchip Technology Inc.
4922  File Name:
4923  drv_usart_definitions.h
4924  Summary:
4925  USART Driver Definitions Header File
4926  Description:
4927  This file will provide enumerations and other dependencies needed by
4928  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4929 *******************************************************************************/
4930 //DOM-IGNORE-BEGIN
4931 /*******************************************************************************
4932 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4933 Microchip licenses to you the right to use, modify, copy and distribute
4934 Software only when embedded on a Microchip microcontroller or digital signal
4935 controller that is integrated into your product or third party product
4936 (pursuant to the sublicense terms in the accompanying license agreement).
4937 You should refer to the license agreement accompanying this Software for
4938 additional information regarding your rights and obligations.
4939 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4940 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4941 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4942 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4943 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4944 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4945 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4946 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4947 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4948 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4949 *******************************************************************************/
4950 //DOM-IGNORE-END
4951 #ifndef _DRV_USART_DEFINITIONS_H
4952 #define _DRV_USART_DEFINITIONS_H
4953 // *****************************************************************************
4954 // *****************************************************************************
4955 // Section: File includes
4956 // *****************************************************************************
4957 // *****************************************************************************
4958 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4959 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4960 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4961 /*******************************************************************************
4962  USART Peripheral Library Interface Header
4963  Company:
4964  Microchip Technology Inc.
4965  File Name:
4966  plib_usart.h
4967  Summary:
4968  USART Peripheral Library interface header.
4969  Description:
4970  This header file contains the function prototypes and definitions of
4971  the data types and constants that make up the interface to the USART
4972  Peripheral Library for all families of Microchip microcontrollers. The
4973  functions in this file are common to the USART module.
4974  *******************************************************************************/
4975 // DOM-IGNORE-BEGIN
4976 /*******************************************************************************
4977 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4978 Microchip licenses to you the right to use, modify, copy and distribute
4979 Software only when embedded on a Microchip microcontroller or digital signal
4980 controller that is integrated into your product or third party product
4981 (pursuant to the sublicense terms in the accompanying license agreement).
4982 You should refer to the license agreement accompanying this Software for
4983 additional information regarding your rights and obligations.
4984 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4985 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4986 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4987 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4988 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4989 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4990 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4991 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4992 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4993 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4994  *******************************************************************************/
4995 // DOM-IGNORE-END
4996 #ifndef _PLIB_USART_H
4997 #define _PLIB_USART_H
4998 // DOM-IGNORE-BEGIN
4999 // DOM-IGNORE-END
5000 // ****************************************************************************
5001 // ****************************************************************************
5002 // Section: Included Files
5003 // ****************************************************************************
5004 // ****************************************************************************
5005 /* This section lists the other files that are included in this file.
5006 */
5007 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
5008 /*******************************************************************************
5009  Processor Selector File for the USART
5010  Company:
5011  Microchip Technology Incorporated
5012  File Name:
5013  processor.h
5014  Summary:
5015  Selects the appropriate header for the part family
5016  Description:
5017  This file selects the appropriate header for the part family
5018  *******************************************************************************/
5019 // DOM-IGNORE-BEGIN
5020 /*******************************************************************************
5021 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
5022 Microchip licenses to you the right to use, modify, copy and distribute
5023 Software only when embedded on a Microchip microcontroller or digital signal
5024 controller that is integrated into your product or third party product
5025 (pursuant to the sublicense terms in the accompanying license agreement).
5026 You should refer to the license agreement accompanying this Software for
5027 additional information regarding your rights and obligations.
5028 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
5029 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
5030 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
5031 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
5032 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
5033 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
5034 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
5035 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
5036 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
5037 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
5038  *******************************************************************************/
5039 // DOM-IGNORE-END
5040 #ifndef _USART_PROCESSOR_H
5041 #define _USART_PROCESSOR_H
5042 // *****************************************************************************
5043 // *****************************************************************************
5044 // Section: Included Files
5045 // *****************************************************************************
5046 // *****************************************************************************
5047 /* This section lists the other files that are included in this file.
5048  */
5049 #include <stdint.h>
5050 #include <stdbool.h>
5051 #error "No Processor Family specified"
5052  //
5053  // _USART_PROCESSOR_H
5054 /*******************************************************************************
5055  End of File
5056  */
5057 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
5058 /* CLOSE_FILE Include File */
5059 
5060 // ****************************************************************************
5061 // ****************************************************************************
5062 // Section: USART Peripheral Library Interface Functions
5063 // ****************************************************************************
5064 // ****************************************************************************
5065 //******************************************************************************
5066 /* Function:
5067  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
5068  Summary:
5069  Enables the USART module to continue to operate when an overflow error
5070  condition has occurred.
5071  Description:
5072  This function enables the USART module to continue to operate when an
5073  overflow error condition has occurred.
5074  This operation is atomic.
5075  Precondition:
5076  None.
5077  Parameters:
5078  index - Identifier for the device instance to be configured
5079  Returns:
5080  None.
5081  Example:
5082  <code>
5083 #define MY_USART_INSTANCE USART_ID_1
5084  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
5085  </code>
5086  Remarks:
5087  This feature may not be available on all devices. Please refer to the
5088  specific device data sheet to determine availability or use
5089  PLIB_USART_ExistsRunInOverflow in your application to determine
5090  whether this feature is available.
5091 */
5092 
5093 void
5095  USART_MODULE_ID index ) ;
5096 //******************************************************************************
5097 /* Function:
5098  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
5099  Summary:
5100  Disables the Run in overflow condition mode.
5101  Description:
5102  This function disables the USART module from accepting new data when an overflow
5103  error condition is detected.
5104  This operation is atomic.
5105  Precondition:
5106  None.
5107  Parameters:
5108  index - Identifier for the device instance to be configured
5109  Returns:
5110  None.
5111  Example:
5112  <code>
5113 #define MY_USART_INSTANCE USART_ID_1
5114  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
5115  </code>
5116  Remarks:
5117  This feature may not be available on all devices. Please refer to the
5118  specific device data sheet to determine availability or use
5119  PLIB_USART_ExistsRunInOverflow in your application to determine
5120  whether this feature is available.
5121 */
5122 
5123 void
5125  USART_MODULE_ID index ) ;
5126 //******************************************************************************
5127 /* Function:
5128  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
5129  Summary:
5130  Gets the status of the Run in Overflow condition.
5131  Description:
5132  This function indicates if the USART module has been enabled to run in
5133  an overflow condition.
5134  This operation is atomic.
5135  Precondition:
5136  None.
5137  Parameters:
5138  index - Identifier for the device instance
5139  Returns:
5140  - true - Run in overflow condition is enabled
5141  - false - Run in overflow condition is disabled
5142  Example:
5143  <code>
5144 #define MY_USART_INSTANCE USART_ID_1
5145  bool status;
5146  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
5147  </code>
5148  Remarks:
5149  This feature may not be available on all devices. Please refer to the
5150  specific device data sheet to determine availability or use
5151  PLIB_USART_ExistsRunInOverflow in your application to determine
5152  whether this feature is available.
5153 */
5154 
5155 bool
5157  USART_MODULE_ID index ) ;
5158 //******************************************************************************
5159 /* Function:
5160  void PLIB_USART_BRGClockSourceSelect
5161  (
5162  USART_MODULE_ID index,
5163  USART_BRG_CLOCK_SOURCE brgClockSource
5164  )
5165  Summary:
5166  Configures the BRG clock source of the USART module.
5167  Description:
5168  This function configures the BRG Clock source of the USART. Refer to
5169  USART_BRG_CLOCK_SOURCE for the possible clock sources.
5170  Precondition:
5171  None.
5172  Parameters:
5173  index - Identifier for the device instance to be configured
5174  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
5175  Returns:
5176  None.
5177  Example:
5178  <code>
5179 #define MY_USART_INSTANCE USART_ID_1
5180  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
5181  </code>
5182  Remarks:
5183  This feature may not be available on all devices. Please refer to the
5184  specific device data sheet to determine availability or use
5185  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
5186  whether this feature is available.
5187 */
5188 
5189 void
5191  USART_MODULE_ID index ,
5192  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
5193 //******************************************************************************
5194 /* Function:
5195  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
5196  Summary:
5197  Gets the BRG clock source of the USART module.
5198  Description:
5199  This function returns the BRG Clock source of the USART. Refer to
5200  USART_BRG_CLOCK_SOURCE for the possible clock sources.
5201  This operation is atomic.
5202  Precondition:
5203  None.
5204  Parameters:
5205  index - Identifier for the device instance
5206  Returns:
5207  One of the possible values of USART_BRG_CLOCK_SOURCE
5208  Example:
5209  <code>
5210 #define MY_USART_INSTANCE USART_ID_1
5211  USART_BRG_CLOCK_SOURCE brgClockSource;
5212  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
5213  </code>
5214  Remarks:
5215  This feature may not be available on all devices. Please refer to the
5216  specific device data sheet to determine availability or use
5217  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
5218  whether this feature is available.
5219 */
5220 
5221 USART_BRG_CLOCK_SOURCE
5223  USART_MODULE_ID index ) ;
5224 //******************************************************************************
5225 /* Function:
5226  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
5227  Summary:
5228  Returns the USART module's running status.
5229  Description:
5230  This function checks if the USART module status is busy. The following
5231  functions should not be used when the module status is busy:
5232  - PLIB_USART_LineControlModeSelect
5233  - PLIB_USART_BaudRateHighSet
5234  - PLIB_USART_BaudRateHighEnable
5235  - PLIB_USART_BaudRateHighDisable
5236  - PLIB_USART_ReceiverIdleStateLowEnable
5237  - PLIB_USART_ReceiverIdleStateLowDisable
5238  - PLIB_USART_BaudRateAutoDetectEnable
5239  - PLIB_USART_LoopbackEnable
5240  - PLIB_USART_LoopbackDisable
5241  - PLIB_USART_WakeOnStartEnable
5242  - PLIB_USART_WakeOnStartDisable
5243  - PLIB_USART_OperationModeSelect
5244  - PLIB_USART_HandshakeModeSelect
5245  - PLIB_USART_IrDAEnable
5246  - PLIB_USART_IrDADisable
5247  - PLIB_USART_StopInIdleEnable
5248  - PLIB_USART_StopInIdleDisable
5249  - PLIB_USART_RunInOverflowEnable
5250  - PLIB_USART_RunInOverflowDisable
5251  - PLIB_USART_BRGClockSourceSelect
5252  - PLIB_USART_RunInSleepModeEnable
5253  - PLIB_USART_RunInSleepModeDisable
5254  This operation is atomic.
5255  Precondition:
5256  None.
5257  Parameters:
5258  index - Identifier for the device instance
5259  Returns:
5260  - true - USART module is busy
5261  - false - USART module is idle
5262  Example:
5263  <code>
5264 #define MY_USART_INSTANCE USART_ID_1
5265  bool moduleStatus;
5266  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
5267  </code>
5268  Remarks:
5269  This feature may not be available on all devices. Please refer to the
5270  specific device data sheet to determine availability or use
5271  PLIB_USART_ExistsModuleBusyStatus in your application to determine
5272  whether this feature is available.
5273 */
5274 
5275 bool
5277  USART_MODULE_ID index ) ;
5278 //******************************************************************************
5279 /* Function:
5280  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
5281  Summary:
5282  Allows the USART module's BRG clock to run when the device enters Sleep mode.
5283  Description:
5284  This function enables the USART module's BRG clock to continue operation when
5285  the device enters the Sleep mode.
5286  This operation is atomic.
5287  Precondition:
5288  None.
5289  Parameters:
5290  index - Identifier for the device instance to be configured
5291  Returns:
5292  None.
5293  Example:
5294  <code>
5295 #define MY_USART_INSTANCE USART_ID_1
5296  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
5297  </code>
5298  Remarks:
5299  This feature may not be available on all devices. Please refer to the
5300  specific device data sheet to determine availability or use
5301  PLIB_USART_ExistsRunInSleepMode in your application to determine
5302  whether this feature is available.
5303 */
5304 
5305 void
5307  USART_MODULE_ID index ) ;
5308 //******************************************************************************
5309 /* Function:
5310  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
5311  Summary:
5312  Turns off the USART module's BRG clock during Sleep mode.
5313  Description:
5314  This function turns off the USART module's BRG clock during Sleep mode.
5315  This operation is atomic.
5316  Precondition:
5317  None.
5318  Parameters:
5319  index - Identifier for the device instance to be configured
5320  Returns:
5321  None.
5322  Example:
5323  <code>
5324 #define MY_USART_INSTANCE USART_ID_1
5325  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
5326  </code>
5327  Remarks:
5328  This feature may not be available on all devices. Please refer to the
5329  specific device data sheet to determine availability or use
5330  PLIB_USART_ExistsRunInSleepMode in your application to determine
5331  whether this feature is available.
5332 */
5333 
5334 void
5336  USART_MODULE_ID index ) ;
5337 //******************************************************************************
5338 /* Function:
5339  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
5340  Summary:
5341  Gets the status of Run in Sleep mode.
5342  Description:
5343  This function indicates if the USART module has been enabled to run in
5344  Sleep mode.
5345  This operation is atomic.
5346  Precondition:
5347  None.
5348  Parameters:
5349  index - Identifier for the device instance
5350  Returns:
5351  - true - Run in Sleep mode is enabled
5352  - false - Run in Sleep mode is disabled
5353  Example:
5354  <code>
5355 #define MY_USART_INSTANCE USART_ID_1
5356  bool status;
5357  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
5358  </code>
5359  Remarks:
5360  This feature may not be available on all devices. Please refer to the
5361  specific device data sheet to determine availability or use
5362  PLIB_USART_ExistsRunInSleepMode in your application to determine
5363  whether this feature is available.
5364 */
5365 
5366 bool
5368  USART_MODULE_ID index ) ;
5369 //******************************************************************************
5370 /* Function:
5371  void PLIB_USART_Enable ( USART_MODULE_ID index )
5372  Summary:
5373  Enables the specific USART module.
5374  Description:
5375  This function enables the specific USART module.
5376  This operation is atomic.
5377  Precondition:
5378  None.
5379  Parameters:
5380  index - Identifier for the device instance to be configured
5381  Returns:
5382  None.
5383  Example:
5384  <code>
5385 #define MY_USART_INSTANCE USART_ID_1
5386  PLIB_USART_Enable(MY_USART_INSTANCE);
5387  </code>
5388  Remarks:
5389  By calling this function, the USART pins are controlled by the USART
5390  module.
5391  This feature may not be available on all devices. Please refer to the
5392  specific device data sheet to determine availability or use
5393  PLIB_USART_ExistsEnable in your application to determine whether
5394  this feature is available.
5395 */
5396 
5397 void
5399  USART_MODULE_ID index ) ;
5400 //******************************************************************************
5401 /* Function:
5402  void PLIB_USART_Disable ( USART_MODULE_ID index )
5403  Summary:
5404  Disables the specific USART module
5405  Description:
5406  This function disables the specific USART module.
5407  This operation is atomic.
5408  Precondition:
5409  None.
5410  Parameters:
5411  index - Identifier for the device instance to be configured
5412  Returns:
5413  None.
5414  Example:
5415  <code>
5416 #define MY_USART_INSTANCE USART_ID_1
5417  PLIB_USART_Disable(MY_USART_INSTANCE);
5418  </code>
5419  Remarks:
5420  The default state after any reset for a USART module is the disable state.
5421  If the USART is disabled, all of the related pins are in control of the
5422  general purpose I/O logic.
5423 
5424  Disabling the USART module resets the buffers to empty states. Any data
5425  characters in the buffers are lost and the baud rate is reset. All error
5426  and status bits are also reset.
5427 
5428  Disabling the USART while the USART is active, will abort all pending
5429  transmissions and receptions. Re-enabling the USART will restart the
5430  module in the same configuration.
5431 
5432  When disabled, the USART power consumption is minimal.
5433  This feature may not be available on all devices. Please refer to the
5434  specific device data sheet to determine availability or use
5435  PLIB_USART_ExistsEnable in your application to determine whether
5436  this feature is available.
5437 */
5438 
5439 void
5441  USART_MODULE_ID index ) ;
5442 //******************************************************************************
5443 /* Function:
5444  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
5445  Summary:
5446  Enables the specific USART module transmitter.
5447  Description:
5448  This function enables the specific USART module transmitter.
5449  This operation is atomic.
5450  Precondition:
5451  The USART module should be enabled using the function PLIB_USART_Enable
5452  before this function is called.
5453  Parameters:
5454  index - Identifier for the device instance to be configured
5455  Returns:
5456  None.
5457  Example:
5458  <code>
5459 #define MY_USART_INSTANCE USART_ID_1
5460  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
5461  </code>
5462  Remarks:
5463  The transmitter should not be enabled until the USART is enabled.
5464  The transmissions will not be enabled otherwise.
5465 
5466  This feature may not be available on all devices. Please refer to the
5467  specific device data sheet to determine availability or use
5468  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5469  this feature is available.
5470 */
5471 
5472 void
5474  USART_MODULE_ID index ) ;
5475 //******************************************************************************
5476 /* Function:
5477  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
5478  Summary:
5479  Disables the specific USART module transmitter.
5480  Description:
5481  This function disables the specific USART module transmitter.
5482  This operation is atomic.
5483  Precondition:
5484  None.
5485  Parameters:
5486  index - Identifier for the device instance to be configured
5487  Returns:
5488  None.
5489  Example:
5490  <code>
5491 #define MY_USART_INSTANCE USART_ID_1
5492  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
5493  </code>
5494  Remarks:
5495  Disabling the transmitter during a transmission will cause the
5496  transmission to be aborted.
5497 
5498  This feature may not be available on all devices. Please refer to the
5499  specific device data sheet to determine availability or use
5500  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5501  this feature is available.
5502 */
5503 
5504 void
5506  USART_MODULE_ID index ) ;
5507 //******************************************************************************
5508 /* Function:
5509  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
5510  uint32_t baudRate );
5511  Summary:
5512  Sets the baud rate to the desired value.
5513  Description:
5514  This function sets the baud rate to the desired value.
5515  Precondition:
5516  None.
5517  Parameters:
5518  index - Identifier for the device instance to be configured
5519  baudRate - Baud Rate Value
5520  clockFrequency - Clock Frequency
5521  Returns:
5522  None.
5523  Example:
5524  <code>
5525 #define MY_USART_INSTANCE USART_ID_1
5526  uint32_t baudRateValue ;
5527  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5528  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5529  </code>
5530  Remarks:
5531  Setting a new baud rate value causes the baud rate timer to reset.
5532  This ensures that the baud rate timer does not have to overflow before
5533  outputting the new baud rate.
5534 
5535  If the system clock is changed during an active receive operation, a
5536  receiver error or data loss may result. To avoid this issue verify that
5537  no receptions are in progress before changing the system clock.
5538 
5539  This feature may not be available on all devices. Please refer to the
5540  specific device data sheet to determine availability or use
5541  PLIB_USART_ExistsBaudRate in your application to determine whether
5542  this feature is available.
5543 */
5544 
5545 void
5547  USART_MODULE_ID index ,
5548  uint32_t clockFrequency ,
5549  uint32_t baudRate ) ;
5550 //******************************************************************************
5551 /* Function:
5552  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5553  uint32_t clockFrequency, uint32_t baudRate );
5554  Summary:
5555  Sets the baud rate to the desired value.
5556  Description:
5557  This function sets the baud rate to the desired value.
5558  Precondition:
5559  None.
5560  Parameters:
5561  index - Identifier for the device instance to be configured
5562  baudRate - Baud Rate Value, it is the baud rate value
5563  clockFrequency - Clock Frequency
5564  Returns:
5565  None.
5566  Example:
5567  <code>
5568 #define MY_USART_INSTANCE USART_ID_1
5569  uint32_t baudRateValue ;
5570  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5571  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5572  </code>
5573  Remarks:
5574  Setting a new baud rate value causes the baud rate timer to reset.
5575  This ensures that the baud rate timer does not have to overflow before
5576  outputting the new baud rate.
5577 
5578  If the system clock is changed during an active receive operation, a
5579  receiver error or data loss may result. To avoid this issue verify that
5580  no receptions are in progress before changing the system clock.
5581 
5582  This feature may not be available on all devices. Please refer to the
5583  specific device data sheet to determine availability or use
5584  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5585  this feature is available.
5586 */
5587 
5588 void
5590  USART_MODULE_ID index ,
5591  uint32_t clockFrequency ,
5592  uint32_t baudRate ) ;
5593 //******************************************************************************
5594 /* Function:
5595  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5596  int32_t clockFrequency );
5597  Summary:
5598  Gets the baud rate current in use.
5599  Description:
5600  This function gets the baud rate that is currently in use. The clock frequency
5601  needs to be passed to the function.
5602  Conditions:
5603  None.
5604  Input:
5605  index - Identifier for the device instance to be configured
5606  clockFrequency - Clock Frequency
5607  Returns:
5608  - BaudRate - Baud rate value
5609  Example:
5610  <code>
5611 #define MY_USART_INSTANCE USART_ID_1
5612  uint32_t baudRate ;
5613  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5614  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5615  </code>
5616  Remarks:
5617  This feature may not be available on all devices. Please refer to the
5618  specific device data sheet to determine availability or use
5619  PLIB_USART_ExistsBaudRate in your application to determine whether
5620  this feature is available.
5621 */
5622 
5623 uint32_t
5625  USART_MODULE_ID index ,
5626  int32_t clockFrequency ) ;
5627 //******************************************************************************
5628 /* Function:
5629  void PLIB_USART_AddressSet
5630  (
5631  USART_MODULE_ID index,
5632  uint8_t address
5633  )
5634  Summary:
5635  Sets the address for the Address Detect mode.
5636  Description:
5637  This function sets the address for the Address Detect mode.
5638  This operation is atomic.
5639  Precondition:
5640  None.
5641  Parameters:
5642  index - Identifier for the device instance to be configured
5643  address - Address
5644  Returns:
5645  None.
5646  Example:
5647  <code>
5648 #define MY_USART_INSTANCE USART_ID_1
5649  uint8_t address = 0x02;
5650  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5651  </code>
5652  Remarks:
5653  This feature may not be available on all devices. Please refer to the
5654  specific device data sheet to determine availability or use
5655  PLIB_USART_ExistsReceiverAddress in your application to determine
5656  whether this feature is available.
5657 */
5658 
5659 void
5661  USART_MODULE_ID index ,
5662  uint8_t address ) ;
5663 //******************************************************************************
5664 /* Function:
5665  uint8_t PLIB_USART_AddressGet
5666  (
5667  USART_MODULE_ID index
5668  )
5669  Summary:
5670  Gets the address for the Address Detect mode.
5671  Description:
5672  This function returns the address value being used for the Address
5673  Detect mode.
5674  This operation is atomic.
5675  Precondition:
5676  None.
5677  Parameters:
5678  index - Identifier for the device instance
5679  Returns:
5680  - address - The address being used
5681  Example:
5682  <code>
5683 #define MY_USART_INSTANCE USART_ID_1
5684  uint8_t address = 0;
5685  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5686  </code>
5687  Remarks:
5688  This feature may not be available on all devices. Please refer to the
5689  specific device data sheet to determine availability or use
5690  PLIB_USART_ExistsReceiverAddress in your application to determine
5691  whether this feature is available.
5692 */
5693 
5694 uint8_t
5696  USART_MODULE_ID index ) ;
5697 //******************************************************************************
5698 /* Function:
5699  void PLIB_USART_AddressMaskSet
5700  (
5701  USART_MODULE_ID index,
5702  uint8_t mask
5703  )
5704  Summary:
5705  Sets the address mask for the Address Detect mode.
5706  Description:
5707  This function sets the address mask for the Address Detect mode.
5708  This operation is atomic.
5709  Precondition:
5710  None.
5711  Parameters:
5712  index - Identifier for the device instance to be configured
5713  mask - Address match mask bits
5714  Returns:
5715  None.
5716  Example:
5717  <code>
5718 #define MY_USART_INSTANCE USART_ID_1
5719  uint8_t mask = 0x0F;
5720  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5721  </code>
5722  Remarks:
5723  This feature may not be available on all devices. Please refer to the
5724  specific device data sheet to determine availability or use
5725  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5726  whether this feature is available.
5727 */
5728 
5729 void
5731  USART_MODULE_ID index ,
5732  uint8_t mask ) ;
5733 //******************************************************************************
5734 /* Function:
5735  uint8_t PLIB_USART_AddressMaskGet
5736  (
5737  USART_MODULE_ID index
5738  )
5739  Summary:
5740  Gets the address mask for the Address Detect mode.
5741  Description:
5742  This function returns the address mask value being used for the Address
5743  Detect mode.
5744  This operation is atomic.
5745  Precondition:
5746  None.
5747  Parameters:
5748  index - Identifier for the device instance to be configured
5749  Returns:
5750  - mask - Address mask being used
5751  Example:
5752  <code>
5753 #define MY_USART_INSTANCE USART_ID_1
5754  uint8_t mask = 0;
5755  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5756  </code>
5757  Remarks:
5758  This feature may not be available on all devices. Please refer to the
5759  specific device data sheet to determine availability or use
5760  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5761  whether this feature is available.
5762 */
5763 
5764 uint8_t
5766  USART_MODULE_ID index ) ;
5767 //******************************************************************************
5768 /* Function:
5769  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5770  Summary:
5771  Enables the Address Detect mode.
5772  Description:
5773  This function enables the Address Detect mode. If it is enabled, and the
5774  device is addressed, disable the Address Detect mode to continue receiving
5775  bytes.
5776  This operation is atomic.
5777  Precondition:
5778  None.
5779  Parameters:
5780  index - Identifier for the device instance to be configured
5781  Returns:
5782  None.
5783  Example:
5784  <code>
5785 #define MY_USART_INSTANCE USART_ID_1
5786  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5787  </code>
5788  Remarks:
5789  If 9 data bits are not selected, this bit has no effect.
5790  This feature may not be available on all devices. Please refer to the
5791  specific device data sheet to determine availability or use
5792  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5793  this feature is available.
5794 */
5795 
5796 void
5798  USART_MODULE_ID index ) ;
5799 //******************************************************************************
5800 /* Function:
5801  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5802  Summary:
5803  Enables the Address Detect mode.
5804  Description:
5805  This function disables the Address Detect mode. If it is enabled, and the
5806  device is addressed, disable the Address Detect mode to continue receiving
5807  bytes.
5808  This operation is atomic.
5809  Precondition:
5810  None.
5811  Parameters:
5812  index - Identifier for the device instance to be configured
5813  Returns:
5814  None.
5815  Example:
5816  <code>
5817 #define MY_USART_INSTANCE USART_ID_1
5818  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5819  </code>
5820  Remarks:
5821  All bytes are received, and the 9th bit can be used as the parity bit.
5822  By default, the address detect is disabled.
5823 
5824  This feature may not be available on all devices. Please refer to the
5825  specific device data sheet to determine availability or use
5826  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5827  this feature is available.
5828 */
5829 
5830 void
5832  USART_MODULE_ID index ) ;
5833 //******************************************************************************
5834 /* Function:
5835  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5836  Summary:
5837  Gets the state of the automatic baud detection.
5838  Description:
5839  This function gets the state of the automatic baud detection and returns a '0'
5840  if the baud rate auto detection is complete.
5841  This operation is atomic.
5842  Precondition:
5843  None.
5844  Parameters:
5845  index - Identifier for the device instance to be configured
5846  Returns:
5847  - true - Baud rate detection is not complete
5848  - false - Baud rate detection is complete
5849  Example:
5850  <code>
5851 #define MY_USART_INSTANCE USART_ID_1
5852  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5853  // Wait until the baud rate is detected.
5854  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5855  </code>
5856  Remarks:
5857  This feature may not be available on all devices. Please refer to the
5858  specific device data sheet to determine availability or use
5859  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5860  this feature is available.
5861 */
5862 
5863 bool
5865  USART_MODULE_ID index ) ;
5866 //******************************************************************************
5867 /* Function:
5868  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5869  Summary:
5870  Enables baud rate measurement on the next character, which requires reception
5871  of the Sync character.
5872  Description:
5873  This function enables the baud rate measurement on the next character,
5874  which requires reception of the Sync character.
5875  This operation is atomic.
5876  Precondition:
5877  None.
5878  Parameters:
5879  index - Identifier for the device instance to be configured
5880  Returns:
5881  None.
5882  Example:
5883  <code>
5884 #define MY_USART_INSTANCE USART_ID_1
5885  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5886  // Wait until the baud rate is detected.
5887  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5888  </code>
5889  Remarks:
5890  This feature may not be available on all devices. Please refer to the
5891  specific device data sheet to determine availability or use
5892  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5893  this feature is available.
5894 */
5895 
5896 void
5898  USART_MODULE_ID index ) ;
5899 //******************************************************************************
5900 /* Function:
5901  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5902  Summary:
5903  Data to be transmitted in the Byte mode.
5904  Description:
5905  The data is transmitted in the Byte mode for the specified USART module.
5906  This operation is atomic.
5907  Precondition:
5908  None.
5909  Parameters:
5910  index - Identifier for the device instance to be configured
5911  data - Data to be transmitted.
5912  Returns:
5913  None.
5914  Example:
5915  <code>
5916 #define MY_USART_INSTANCE USART_ID_1
5917  uint8_t data = 'a';
5918  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5919  {
5920  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5921  }
5922  </code>
5923  Remarks:
5924  This feature may not be available on all devices. Please refer to the
5925  specific device data sheet to determine availability or use
5926  PLIB_USART_ExistsTransmitter in your application to determine whether
5927  this feature is available.
5928 */
5929 
5930 void
5932  USART_MODULE_ID index ,
5933  int8_t data ) ;
5934 //******************************************************************************
5935 /* Function:
5936  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5937  Summary:
5938  Data to be received in the Byte mode.
5939  Description:
5940  The data to be received in Byte mode from the specified USART module.
5941  This operation is atomic.
5942  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5943  PLIB_USART_ReceiverParityErrorHasOccurred and
5944  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5945  Precondition:
5946  None.
5947  Parameters:
5948  index - Identifier for the device instance to be configured
5949  Returns:
5950  - data - Data to be received
5951  Example:
5952  <code>
5953 #define MY_USART_INSTANCE USART_ID_1
5954  bool isError;
5955  uint8_t mydata;
5956  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5957  {
5958  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5959  }
5960  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5961  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5962  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5963  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5964  {
5965  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5966  }
5967  </code>
5968  Remarks:
5969  This feature may not be available on all devices. Please refer to the
5970  specific device data sheet to determine availability or use
5971  PLIB_USART_ExistsReceiver in your application to determine whether
5972  this feature is available.
5973 */
5974 
5975 int8_t
5977  USART_MODULE_ID index ) ;
5978 //******************************************************************************
5979 /* Function:
5980  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5981  Summary:
5982  Data to be received in the byte mode with the 9th bit.
5983  Description:
5984  The data to be received in Byte mode from the specified USART module.
5985  with the 9th bit.
5986  This operation is atomic.
5987  Precondition:
5988  None.
5989  Parameters:
5990  index - Identifier for the device instance to be configured
5991  Returns:
5992  - data - Data to be received
5993  Example:
5994  <code>
5995 #define MY_USART_INSTANCE USART_ID_1
5996  uint16_t mydata;
5997  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5998  {
5999  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
6000  }
6001  </code>
6002  Remarks:
6003  This feature may not be available on all devices. Please refer to the
6004  specific device data sheet to determine availability or use
6005  PLIB_USART_ExistsReceiver9Bits in your application to determine
6006  whether this feature is available.
6007 */
6008 
6009 int16_t
6011  USART_MODULE_ID index ) ;
6012 //******************************************************************************
6013 /* Function:
6014  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
6015  Summary:
6016  Checks and return if the data received is an address.
6017  Description:
6018  Checks and return if the data received is an address. The address has
6019  the 9th bit set. If data received has the 9th bit set, the function returns true;
6020  otherwise, the function returns false.
6021  This operation is atomic.
6022  Precondition:
6023  The USART module should be configured to use the 9 data bits.
6024  Parameters:
6025  index - Identifier for the device instance to be configured
6026  Returns:
6027  - true - if the data received has the 9th bit set
6028  - false - if the address received has the 9th bit cleared
6029  Example:
6030  <code>
6031 #define MY_USART_INSTANCE USART_ID_1
6032  int8_t address;
6033  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
6034  {
6035  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6036  }
6037  </code>
6038  Remarks:
6039  This feature may not be available on all devices. Please refer to the
6040  specific device data sheet to determine availability or use
6041  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
6042  this feature is available.
6043 */
6044 
6045 bool
6047  USART_MODULE_ID index ) ;
6048 //******************************************************************************
6049 /* Function:
6050  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
6051  int8_t data, bool 9thBit )
6052  Summary:
6053  Data to be transmitted in the byte mode with the 9th bit.
6054  Description:
6055  The data is transmitted in the byte mode for the specified USART module,
6056  with 9th bit.
6057  This operation is atomic.
6058  Precondition:
6059  The USART module should be configured to use the 9 data bits.
6060  Parameters:
6061  index - Identifier for the device instance to be configured
6062  data - Data to be transmitted.
6063  9thBit - 9th bit of the data to be transmitted.
6064  Returns:
6065  None.
6066  Example:
6067  <code>
6068 #define MY_USART_INSTANCE USART_ID_1
6069  uint8_t data = 'a';
6070  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
6071  {
6072  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
6073  }
6074  </code>
6075  Remarks:
6076  This feature may not be available on all devices. Please refer to the
6077  specific device data sheet to determine availability or use
6078  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
6079  this feature is available.
6080 */
6081 
6082 void
6084  USART_MODULE_ID index ,
6085  int8_t data ,
6086  bool Bit9th ) ;
6087 //******************************************************************************
6088 /* Function:
6089  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
6090  Summary:
6091  Transmits the break character.
6092  Description:
6093  This function transmits the break character.
6094  This operation is atomic.
6095  Precondition:
6096  The application should wait for the transmitter to be idle, before calling
6097  this function.
6098  Parameters:
6099  index - Identifier for the device instance to be configured
6100  Returns:
6101  None.
6102  Example:
6103  <code>
6104 #define MY_USART_INSTANCE USART_ID_1
6105  // Wait for the Transmit buffer to be empty.
6106  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6107  // Transmit the break character.
6108  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6109  // wait for the break transmission to complete
6110  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
6111  </code>
6112  Remarks:
6113  After the break has been transmitted, the application can start
6114  transmitting next bytes.
6115 
6116  This feature may not be available on all devices. Please refer to the
6117  specific device data sheet to determine availability or use
6118  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
6119  this feature is available.
6120 */
6121 
6122 void
6124  USART_MODULE_ID index ) ;
6125 //******************************************************************************
6126 /* Function:
6127  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
6128  Summary:
6129  Returns the status of the break transmission
6130  Description:
6131  The function returns the status of the break transmission.
6132  This operation is atomic.
6133  Precondition:
6134  None.
6135  Parameters:
6136  index - Identifier for the device instance to be configured
6137  Returns:
6138  - true - Transmit break on the next transmission
6139  - false - Break transmission completed or not started
6140  Example:
6141  <code>
6142 #define MY_USART_INSTANCE USART_ID_1
6143  // Wait for the Transmit buffer to be empty.
6144  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6145  // Transmit the break character.
6146  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6147  // wait for the break transmission to complete
6148  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
6149  </code>
6150  Remarks:
6151  After the break has been transmitted, the application can start
6152  transmitting next bytes.
6153 
6154  This feature may not be available on all devices. Please refer to the
6155  specific device data sheet to determine availability or use
6156  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
6157  this feature is available.
6158 */
6159 
6160 bool
6162  USART_MODULE_ID index ) ;
6163 //******************************************************************************
6164 /* Function:
6165  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
6166  Summary:
6167  Identifies if the receive data is available for the specified USART module.
6168  Description:
6169  This function identifies if the receive data is available for the specified
6170  USART module.
6171  This operation is atomic.
6172  Precondition:
6173  None.
6174  Parameters:
6175  index - Identifier for the device instance to be configured
6176  Returns:
6177  - true - The data is available
6178  - false - The data is not available
6179  Example:
6180  <code>
6181 #define MY_USART_INSTANCE USART_ID_1
6182  int8_t mydata;
6183  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
6184  {
6185  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6186  }
6187  </code>
6188  Remarks:
6189  This feature may not be available on all devices. Please refer to the
6190  specific device data sheet to determine availability or use
6191  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
6192  whether this feature is available.
6193 */
6194 
6195 bool
6197  USART_MODULE_ID index ) ;
6198 //******************************************************************************
6199 /* Function:
6200  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
6201  Summary:
6202  Clears a USART vverrun error.
6203  Description:
6204  This function clears an overrun error. Clearing the error, resets the receive buffer.
6205  This operation is atomic.
6206  Precondition:
6207  None.
6208  Parameters:
6209  index - Identifier for the device instance to be configured
6210  Returns:
6211  None.
6212  Example:
6213  <code>
6214 #define MY_USART_INSTANCE USART_ID_1
6215  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6216  {
6217  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6218  }
6219  </code>
6220  Remarks:
6221  WARNING: Calling this API will clear all of the previously received data.
6222 
6223  This feature may not be available on all devices. Please refer to the
6224  specific device data sheet to determine availability or use
6225  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6226  whether this feature is available.
6227 */
6228 
6229 void
6231  USART_MODULE_ID index ) ;
6232 //******************************************************************************
6233 /* Function:
6234  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
6235  Summary:
6236  Gets the transmit buffer full status.
6237  Description:
6238  This function gets the transmit status of the specified USART module.
6239  This operation is atomic.
6240  Precondition:
6241  None.
6242  Parameters:
6243  index - Identifier for the device instance to be configured
6244  Returns:
6245  - true - The transmit buffer is full
6246  - false - The transmit buffer is not full, at least one more
6247  character can be written
6248  Example:
6249  <code>
6250 #define MY_USART_INSTANCE USART_ID_1
6251  // Wait for the Transmit buffer to be empty.
6252  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6253  // Transmit the break character.
6254  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6255  </code>
6256  Remarks:
6257  This feature may not be available on all devices. Please refer to the
6258  specific device data sheet to determine availability or use
6259  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
6260  whether this feature is available.
6261 */
6262 
6263 bool
6265  USART_MODULE_ID index ) ;
6266 //******************************************************************************
6267 /* Function:
6268  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
6269  Summary:
6270  Gets the transmit shift register empty status.
6271  Description:
6272  This function gets the transmit shift register empty status.
6273  This operation is atomic.
6274  Precondition:
6275  None.
6276  Parameters:
6277  index - Identifier for the device instance to be configured
6278  Returns:
6279  - true - The transmit shift register is empty
6280  - false - The transmit shift register is not empty
6281  Example:
6282  <code>
6283 #define MY_USART_INSTANCE USART_ID_1
6284  // Wait for the Transmit buffer to be empty.
6285  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
6286  // Transmit the break character.
6287  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6288  </code>
6289  Remarks:
6290  This feature may not be available on all devices. Please refer to the
6291  specific device data sheet to determine availability or use
6292  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
6293  whether this feature is available.
6294 */
6295 
6296 bool
6298  USART_MODULE_ID index ) ;
6299 //******************************************************************************
6300 /* Function:
6301  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
6302  Summary:
6303  Gets the framing error status.
6304  Description:
6305  This function gets the framing error status.
6306  This operation is atomic.
6307  Precondition:
6308  None.
6309  Parameters:
6310  index - Identifier for the device instance to be configured
6311  Returns:
6312  - true - The framing error was detected on the current character
6313  - false - The framing error was not detected on the current
6314  character
6315  Example:
6316  <code>
6317 #define MY_USART_INSTANCE USART_ID_1
6318  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
6319  </code>
6320  Remarks:
6321  Reading the error clears the error.
6322  This feature may not be available on all devices. Please refer to the
6323  specific device data sheet to determine availability or use
6324  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
6325  whether this feature is available.
6326 */
6327 
6328 bool
6330  USART_MODULE_ID index ) ;
6331 //******************************************************************************
6332 /* Function:
6333  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
6334  Summary:
6335  Gets the parity error status.
6336  Description:
6337  This function gets the parity error status.
6338  This operation is atomic.
6339  Precondition:
6340  None.
6341  Parameters:
6342  index - Identifier for the device instance to be configured
6343  Returns:
6344  - true - The parity error was detected on the current character
6345  - false - The parity error was not detected on the current character
6346  Example:
6347  <code>
6348 #define MY_USART_INSTANCE USART_ID_1
6349  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
6350  </code>
6351  Remarks:
6352  Reading the error clears the error.
6353  A Parity error is irrelevant in case of 9-bit mode.
6354  This feature may not be available on all devices. Please refer to the
6355  specific device data sheet to determine availability or use
6356  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
6357  whether this feature is available.
6358 */
6359 
6360 bool
6362  USART_MODULE_ID index ) ;
6363 //******************************************************************************
6364 /* Function:
6365  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
6366  Summary:
6367  Identifies if there was a receiver overrun error.
6368  Description:
6369  This function identifies if there was a receiver overrun error.
6370  This operation is atomic.
6371  Precondition:
6372  None.
6373  Parameters:
6374  index - Identifier for the device instance to be configured
6375  Returns:
6376  - true - The receive buffer has overflowed
6377  - false - The receive buffer has not overflowed
6378  Example:
6379  <code>
6380 #define MY_USART_INSTANCE USART_ID_1
6381  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6382  {
6383  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6384  }
6385  </code>
6386  Remarks:
6387  This feature may not be available on all devices. Please refer to the
6388  specific device data sheet to determine availability or use
6389  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6390  whether this feature is available.
6391 */
6392 
6393 bool
6395  USART_MODULE_ID index ) ;
6396 //******************************************************************************
6397 /* Function:
6398  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
6399  Summary:
6400  Identifies if the receiver is idle.
6401  Description:
6402  This function identifies if the receiver is idle.
6403  This operation is atomic.
6404  Precondition:
6405  None.
6406  Parameters:
6407  index - Identifier for the device instance to be configured
6408  Returns:
6409  - true - The receive buffer is idle
6410  - false - The receive buffer is not idle
6411  Example:
6412  <code>
6413 #define MY_USART_INSTANCE USART_ID_1
6414  int8_t mydata;
6415  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
6416  {
6417  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6418  }
6419  </code>
6420  Remarks:
6421  This feature may not be available on all devices. Please refer to the
6422  specific device data sheet to determine availability or use
6423  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
6424  whether this feature is available.
6425 */
6426 
6427 bool
6429  USART_MODULE_ID index ) ;
6430 //******************************************************************************
6431 /* Function:
6432  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
6433  Summary:
6434  Enables the USART receiver.
6435  Description:
6436  This function enables the USART receiver.
6437  This operation is atomic.
6438  Precondition:
6439  None.
6440  Parameters:
6441  index - Identifier for the device instance to be configured
6442  Returns:
6443  None.
6444  Example:
6445  <code>
6446 #define MY_USART_INSTANCE USART_ID_1
6447  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
6448  </code>
6449  Remarks:
6450  This feature may not be available on all devices. Please refer to the
6451  specific device data sheet to determine availability or use
6452  PLIB_USART_ExistsReceiverEnable in your application to determine
6453  whether this feature is available.
6454 */
6455 
6456 void
6458  USART_MODULE_ID index ) ;
6459 //******************************************************************************
6460 /* Function:
6461  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
6462  Summary:
6463  Disables the USART receiver.
6464  Description:
6465  This function disables the USART receiver.
6466  This operation is atomic.
6467  Precondition:
6468  None.
6469  Parameters:
6470  index - Identifier for the device instance to be configured
6471  Returns:
6472  None.
6473  Example:
6474  <code>
6475 #define MY_USART_INSTANCE USART_ID_1
6476  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
6477  </code>
6478  Remarks:
6479  This feature may not be available on all devices. Please refer to the
6480  specific device data sheet to determine availability or use
6481  PLIB_USART_ExistsReceiverEnable in your application to determine
6482  whether this feature is available.
6483 */
6484 
6485 void
6487  USART_MODULE_ID index ) ;
6488 //******************************************************************************
6489 /* Function:
6490  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
6491  Summary:
6492  Enables the Transmit Idle Low state.
6493  Description:
6494  This function enables the Transmit Idle Low state. In the USART Synchronous
6495  mode, this function configures that the TX polarity, the idle state is low.
6496  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
6497  state to a '1'.
6498  This operation is atomic.
6499  Precondition:
6500  None.
6501  Parameters:
6502  index - Identifier for the device instance to be configured
6503  Returns:
6504  None.
6505  Example:
6506  <code>
6507 #define MY_USART_INSTANCE USART_ID_1
6508  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
6509  </code>
6510  Remarks:
6511  This feature may not be available on all devices. Please refer to the
6512  specific device data sheet to determine availability or use
6513  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6514  whether this feature is available.
6515 */
6516 
6517 void
6519  USART_MODULE_ID index ) ;
6520 //******************************************************************************
6521 /* Function:
6522  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
6523  Summary:
6524  Disables the Transmit Idle Low state.
6525  Description:
6526  This function disables the Transmit Idle Low state. In USART Synchronous mode,
6527  this function configures that the TX polarity the idle state is high.
6528  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
6529  state to a '0'.
6530  This operation is atomic.
6531  Precondition:
6532  None.
6533  Parameters:
6534  index - Identifier for the device instance to be configured
6535  Returns:
6536  None.
6537  Example:
6538  <code>
6539 #define MY_USART_INSTANCE USART_ID_1
6540  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
6541  </code>
6542  Remarks:
6543  This feature may not be available on all devices. Please refer to the
6544  specific device data sheet to determine availability or use
6545  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6546  whether this feature is available.
6547 */
6548 
6549 void
6551  USART_MODULE_ID index ) ;
6552 //******************************************************************************
6553 /* Function:
6554  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6555  Summary:
6556  Enables receive polarity inversion.
6557  Description:
6558  This function enables receive polarity inversion. In the USART Synchronous mode,
6559  this function configures that the data is inverted.
6560  This operation is atomic.
6561  Precondition:
6562  None.
6563  Parameters:
6564  index - Identifier for the device instance to be configured
6565  Returns:
6566  None.
6567  Example:
6568  <code>
6569 #define MY_USART_INSTANCE USART_ID_1
6570  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6571  </code>
6572  Remarks:
6573  This feature may not be available on all devices. Please refer to the
6574  specific device data sheet to determine availability or use
6575  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6576  whether this feature is available.
6577 */
6578 
6579 void
6581  USART_MODULE_ID index ) ;
6582 //******************************************************************************
6583 /* Function:
6584  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6585  Summary:
6586  Disables receive polarity inversion.
6587  This operation is atomic.
6588  Description:
6589  This function disables receive polarity inversion. In the USART Synchronous
6590  mode, this function configures that the data is not inverted.
6591  Precondition:
6592  None.
6593  Parameters:
6594  index - Identifier for the device instance to be configured
6595  Returns:
6596  None.
6597  Example:
6598  <code>
6599 #define MY_USART_INSTANCE USART_ID_1
6600  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6601  </code>
6602  Remarks:
6603  This feature may not be available on all devices. Please refer to the
6604  specific device data sheet to determine availability or use
6605  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6606  whether this feature is available.
6607 */
6608 
6609 void
6611  USART_MODULE_ID index ) ;
6612 //******************************************************************************
6613 /* Function:
6614  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6615  Summary:
6616  Enables high baud rate selection.
6617  Description:
6618  This function enables high baud rate selection.
6619  This operation is atomic.
6620  Precondition:
6621  None.
6622  Parameters:
6623  index - Identifier for the device instance to be configured
6624  Returns:
6625  None.
6626  Example:
6627  <code>
6628 #define MY_USART_INSTANCE USART_ID_1
6629  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6630  </code>
6631  Remarks:
6632  This feature may not be available on all devices. Please refer to the
6633  specific device data sheet to determine availability or use
6634  PLIB_USART_ExistsBaudRateHigh in your application to determine
6635  whether this feature is available.
6636 */
6637 
6638 void
6640  USART_MODULE_ID index ) ;
6641 //******************************************************************************
6642 /* Function:
6643  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6644  Summary:
6645  Disables the high baud rate selection.
6646  Description:
6647  This function disables the high baud rate selection.
6648  This operation is atomic.
6649  Precondition:
6650  None.
6651  Parameters:
6652  index - Identifier for the device instance to be configured
6653  Returns:
6654  None.
6655  Example:
6656  <code>
6657 #define MY_USART_INSTANCE USART_ID_1
6658  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6659  </code>
6660  Remarks:
6661  This feature may not be available on all devices. Please refer to the
6662  specific device data sheet to determine availability or use
6663  PLIB_USART_ExistsBaudRateHigh in your application to determine
6664  whether this feature is available.
6665 */
6666 
6667 void
6669  USART_MODULE_ID index ) ;
6670 //******************************************************************************
6671 /* Function:
6672  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6673  USART_TRANSMIT_INTR_MODE interruptMode )
6674  Summary:
6675  Sets the USART transmitter interrupt mode.
6676  Description:
6677  This function sets the condition in which the USART module should generate
6678  an interrupt.
6679  This operation is atomic.
6680  Precondition:
6681  None.
6682  Parameters:
6683  index - Identifier for the device instance to be configured
6684  interruptMode - Interrupt mode; for possible configurations, refer to
6685  USART_TRANSMIT_INTR_MODE
6686  Returns:
6687  None.
6688  Example:
6689  <code>
6690 #define MY_USART_INSTANCE USART_ID_1
6691  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6692  USART_TRANSMIT_FIFO_EMPTY );
6693  </code>
6694  Remarks:
6695  This feature may not be available on all devices. Please refer to the
6696  specific device data sheet to determine availability or use
6697  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6698  whether this feature is available.
6699 */
6700 
6701 void
6703  USART_MODULE_ID index ,
6704  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6705 //******************************************************************************
6706 /* Function:
6707  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6708  USART_RECEIVE_INTR_MODE interruptMode )
6709  Summary:
6710  Sets the USART receiver FIFO level.
6711  Description:
6712  This function sets the USART receiver FIFO level.
6713  This operation is atomic.
6714  Precondition:
6715  None.
6716  Parameters:
6717  index - Identifier for the device instance to be configured
6718  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6719  Returns:
6720  None.
6721  Example:
6722  <code>
6723 #define MY_USART_INSTANCE USART_ID_1
6724  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6725  USART_RECEIVE_FIFO_ONE_CHAR );
6726  </code>
6727  Remarks:
6728  This feature may not be available on all devices. Please refer to the
6729  specific device data sheet to determine availability or use
6730  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6731  whether this feature is available.
6732 */
6733 
6734 void
6736  USART_MODULE_ID index ,
6737  USART_RECEIVE_INTR_MODE interruptMode ) ;
6738 //******************************************************************************
6739 /* Function:
6740  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6741  USART_LINECONTROL_MODE dataFlowConfig)
6742  Summary:
6743  Sets the data flow configuration.
6744  Description:
6745  This function sets the USART data flow configuration based on the mask
6746  provided and the specified baud rate.
6747  Precondition:
6748  None.
6749  Parameters:
6750  index - Identifier for the device instance to be configured
6751  mode - For possible data flow configurations, refer to
6752  USART_LINECONTROL_MODE
6753  Returns:
6754  None.
6755  Example:
6756  <code>
6757 #define MY_USART_INSTANCE USART_ID_1
6758  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6759  USART_8N1);
6760  </code>
6761  Remarks:
6762  This feature may not be available on all devices. Please refer to the
6763  specific device data sheet to determine availability or use
6764  PLIB_USART_ExistsLineControlMode in your application to determine
6765  whether this feature is available.
6766 */
6767 
6768 void
6770  USART_MODULE_ID index ,
6771  USART_LINECONTROL_MODE dataFlowConfig ) ;
6772 //******************************************************************************
6773 /* Function:
6774  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6775  USART_HANDSHAKE_MODE handshakeConfig)
6776  Summary:
6777  Sets the data flow configuration.
6778  Description:
6779  This function sets the USART data flow configuration based on the mask
6780  provided and the specified baud rate.
6781  Precondition:
6782  None.
6783  Parameters:
6784  index - Identifier for the device instance to be configured
6785  mode - For possible data flow configurations, refer to
6786  USART_HANDSHAKE_MODE
6787  Returns:
6788  None.
6789  Example:
6790  <code>
6791 #define MY_USART_INSTANCE USART_ID_1
6792  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6793  USART_HANDSHAKE_MODE_SIMPLEX);
6794  </code>
6795  Remarks:
6796  This feature may not be available on all devices. Please refer to the
6797  specific device data sheet to determine availability or use
6798  PLIB_USART_ExistsHandshakeMode in your application to determine
6799  whether this feature is available.
6800 */
6801 
6802 void
6804  USART_MODULE_ID index ,
6805  USART_HANDSHAKE_MODE handshakeConfig ) ;
6806 //******************************************************************************
6807 /* Function:
6808  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6809  int8_t Mask)
6810  Summary:
6811  Setup the automatic Address Detect mode.
6812  Description:
6813  This function configures the automatic Address Detect mode. Uses the mask as
6814  the address character for automatic address detection.
6815  This operation is atomic.
6816  Precondition:
6817  None.
6818  Parameters:
6819  index - Identifier for the device instance to be configured
6820  Mask - Address character to be used, when enabled
6821  Returns:
6822  None.
6823  Example:
6824  <code>
6825 #define MY_USART_INSTANCE USART_ID_1
6826  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6827  MY_DEVICE_ADDRESS);
6828  </code>
6829  Remarks:
6830  This feature may not be available on all devices. Please refer to the
6831  specific device data sheet to determine availability or use
6832  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6833  whether this feature is available.
6834 */
6835 
6836 void
6838  USART_MODULE_ID index ,
6839  int8_t Mask ) ;
6840 //******************************************************************************
6841 /* Function:
6842  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6843  USART_MODULE_ID index )
6844  Summary:
6845  Disables the automatic Address Detect mode.
6846  Description:
6847  This function disables the automatic Address Detect mode.
6848  This operation is atomic.
6849  Precondition:
6850  None.
6851  Parameters:
6852  index - Identifier for the device instance to be configured
6853  Returns:
6854  None.
6855  Example:
6856  <code>
6857 #define MY_USART_INSTANCE USART_ID_1
6858  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6859  </code>
6860  Remarks:
6861  This feature may not be available on all devices. Please refer to the
6862  specific device data sheet to determine availability or use
6863  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6864  whether this feature is available.
6865 */
6866 
6867 void
6869  USART_MODULE_ID index ) ;
6870 //******************************************************************************
6871 /* Function:
6872  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6873  Summary:
6874  Enables the IrDA encoder and decoder.
6875  Description:
6876  This function enables the IrDA encoder and decoder.
6877  This operation is atomic.
6878  Precondition:
6879  None.
6880  Parameters:
6881  index - Identifier for the device instance to be configured
6882  Returns:
6883  None.
6884  Example:
6885  <code>
6886 #define MY_USART_INSTANCE USART_ID_1
6887  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6888  </code>
6889  Remarks:
6890  This feature may not be available on all devices. Please refer to the
6891  specific device data sheet to determine availability or use
6892  PLIB_USART_ExistsIrDA in your application to determine
6893  whether this feature is available.
6894 */
6895 
6896 void
6898  USART_MODULE_ID index ) ;
6899 //******************************************************************************
6900 /* Function:
6901  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6902  Summary:
6903  Disables the IrDA encoder and decoder.
6904  Description:
6905  This function disables the IrDA encoder and decoder.
6906  This operation is atomic.
6907  Precondition:
6908  None.
6909  Parameters:
6910  index - Identifier for the device instance to be configured
6911  Returns:
6912  None.
6913  Example:
6914  <code>
6915 #define MY_USART_INSTANCE USART_ID_1
6916  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6917  </code>
6918  Remarks:
6919  By default, the IrDA Encoder and Decoder are disabled.
6920 
6921  This feature may not be available on all devices. Please refer to the
6922  specific device data sheet to determine availability or use
6923  PLIB_USART_ExistsIrDA in your application to determine
6924  whether this feature is available.
6925 */
6926 
6927 void
6929  USART_MODULE_ID index ) ;
6930 //******************************************************************************
6931 /* Function:
6932  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6933  Summary:
6934  Enables Loopback mode.
6935  Description:
6936  This function enables Loopback mode.
6937  This operation is atomic.
6938  Precondition:
6939  None.
6940  Parameters:
6941  index - Identifier for the device instance to be configured
6942  Returns:
6943  None.
6944  Example:
6945  <code>
6946 #define MY_USART_INSTANCE USART_ID_1
6947  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6948  </code>
6949  Remarks:
6950  By default, Loopback mode is disabled.
6951 
6952  This feature may not be available on all devices. Please refer to the
6953  specific device data sheet to determine availability or use
6954  PLIB_USART_ExistsLoopback in your application to determine
6955  whether this feature is available.
6956 */
6957 
6958 void
6960  USART_MODULE_ID index ) ;
6961 //******************************************************************************
6962 /* Function:
6963  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6964  Summary:
6965  Disables Loopback mode.
6966  Description:
6967  This function disables Loopback mode.
6968  This operation is atomic.
6969  Precondition:
6970  None.
6971  Parameters:
6972  index - Identifier for the device instance to be configured
6973  Returns:
6974  None.
6975  Example:
6976  <code>
6977 #define MY_USART_INSTANCE USART_ID_1
6978  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6979  </code>
6980  Remarks:
6981  By default, Loopback mode is disabled.
6982  This feature may not be available on all devices. Please refer to the
6983  specific device data sheet to determine availability or use
6984  PLIB_USART_ExistsLoopback in your application to determine
6985  whether this feature is available.
6986 */
6987 
6988 void
6990  USART_MODULE_ID index ) ;
6991 //******************************************************************************
6992 /* Function:
6993  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6994  USART_OPERATION_MODE operationmode)
6995  Summary:
6996  Configures the operation mode of the USART module.
6997  Description:
6998  This function configures the operation mode of the USART (i.e., controls the
6999  pins used by the USART module). Refer to USART_OPERATION_MODE for the
7000  possible settings.
7001  Precondition:
7002  None.
7003  Parameters:
7004  index - Identifier for the device instance to be configured
7005  operationmode - One of the possible values from USART_OPERATION_MODE
7006  Returns:
7007  None.
7008  Example:
7009  <code>
7010 #define MY_USART_INSTANCE USART_ID_1
7011  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
7012  </code>
7013  Remarks:
7014  This feature may not be available on all devices. Please refer to the
7015  specific device data sheet to determine availability or use
7016  PLIB_USART_ExistsOperationMode in your application to determine
7017  whether this feature is available.
7018 */
7019 
7020 void
7022  USART_MODULE_ID index ,
7023  USART_OPERATION_MODE operationmode ) ;
7024 //******************************************************************************
7025 /* Function:
7026  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
7027  Summary:
7028  Discontinues operation when the device enters Idle mode.
7029  Description:
7030  This function enables the USART module to discontinue operation when the
7031  device enters Idle mode.
7032  This operation is atomic.
7033  Precondition:
7034  None.
7035  Parameters:
7036  index - Identifier for the device instance to be configured
7037  Returns:
7038  None.
7039  Example:
7040  <code>
7041 #define MY_USART_INSTANCE USART_ID_1
7042  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
7043  </code>
7044  Remarks:
7045  This feature may not be available on all devices. Please refer to the
7046  specific device data sheet to determine availability or use
7047  PLIB_USART_ExistsStopInIdle in your application to determine
7048  whether this feature is available.
7049 */
7050 
7051 void
7053  USART_MODULE_ID index ) ;
7054 //******************************************************************************
7055 /* Function:
7056  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
7057  Summary:
7058  Disables the Stop in Idle mode (the USART module continues operation when
7059  the device is in Idle mode).
7060  Description:
7061  This function disables the Stop in Idle mode. The USART module continues
7062  operation when the device is in Idle mode.
7063  This operation is atomic.
7064  Precondition:
7065  None.
7066  Parameters:
7067  index - Identifier for the device instance to be configured
7068  Returns:
7069  None.
7070  Example:
7071  <code>
7072 #define MY_USART_INSTANCE USART_ID_1
7073  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
7074  </code>
7075  Remarks:
7076  By default, the USART module will continue operation in Idle mode.
7077 
7078  This feature may not be available on all devices. Please refer to the
7079  specific device data sheet to determine availability or use
7080  PLIB_USART_ExistsStopInIdle in your application to determine
7081  whether this feature is available.
7082 */
7083 
7084 void
7086  USART_MODULE_ID index ) ;
7087 //******************************************************************************
7088 /* Function:
7089  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
7090  Summary:
7091  Enables the wake-up on start bit detection feature during Sleep mode.
7092  Description:
7093  This function enables the wake-up on start feature during Sleep mode.
7094  This operation is atomic.
7095  Precondition:
7096  None.
7097  Parameters:
7098  index - Identifier for the device instance to be configured
7099  Returns:
7100  None.
7101  Example:
7102  <code>
7103 #define MY_USART_INSTANCE USART_ID_1
7104  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
7105  </code>
7106  Remarks:
7107  This feature may not be available on all devices. Please refer to the
7108  specific device data sheet to determine availability or use
7109  PLIB_USART_ExistsWakeOnStart in your application to determine
7110  whether this feature is available.
7111 */
7112 
7113 void
7115  USART_MODULE_ID index ) ;
7116 //******************************************************************************
7117 /* Function:
7118  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
7119  Summary:
7120  Disables the wake-up on start bit detection feature during Sleep mode.
7121  Description:
7122  This function disables the wake-up on start bit detection feature during
7123  Sleep mode.
7124  This operation is atomic.
7125  Precondition:
7126  None.
7127  Parameters:
7128  index - Identifier for the device instance to be configured
7129  Returns:
7130  None.
7131  Example:
7132  <code>
7133 #define MY_USART_INSTANCE USART_ID_1
7134  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
7135  </code>
7136  Remarks:
7137  This feature may not be available on all devices. Please refer to the
7138  specific device data sheet to determine availability or use
7139  PLIB_USART_ExistsWakeOnStart in your application to determine
7140  whether this feature is available.
7141 */
7142 
7143 void
7145  USART_MODULE_ID index ) ;
7146 //******************************************************************************
7147 /* Function:
7148  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
7149  Summary:
7150  Gets the state of the sync break event completion.
7151  Description:
7152  This function returns the status of the sync break event, when called
7153  after enabling using PLIB_USART_WakeOnStartEnable.
7154  This operation is atomic.
7155  Precondition:
7156  None.
7157  Parameters:
7158  index - Identifier for the device instance to be configured
7159  Returns:
7160  None.
7161  Example:
7162  <code>
7163 #define MY_USART_INSTANCE USART_ID_1
7164  //Call the interface just prior to entering the sleep mode.
7165  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
7166  // Check the status if the Sync break event is over.
7167  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
7168  {
7169  // Do Something
7170  }
7171  </code>
7172  Remarks:
7173  This feature may not be available on all devices. Please refer to the
7174  specific device data sheet to determine availability or use
7175  PLIB_USART_ExistsWakeOnStart in your application to determine
7176  whether this feature is available.
7177 */
7178 
7179 bool
7181  USART_MODULE_ID index ) ;
7182 //******************************************************************************
7183 /* Function:
7184  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
7185  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
7186  Summary:
7187  Enables or disables general features of the USART module.
7188  Description:
7189  This function enables or disables general features of the USART module.
7190  Precondition:
7191  None.
7192  Parameters:
7193  index - Identifier for the device instance to be configured
7194  autobaud - If true, auto baud rate detection is enabled. If false
7195  the feature is disabled.
7196  loopBackMode - If true, loop back is enabled. If false the feature is
7197  disabled.
7198  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
7199  mode on USART activity. If false the feature is disabled.
7200  irdaMode - If true, the IrDA mode is enabled. If false the feature
7201  is disabled.
7202  stopInIdle - If true, module will stop functioning when CPU enters Idle
7203  mode. If false, the feature is disabled.
7204  Returns:
7205  None.
7206  Example:
7207  <code>
7208 #define MY_USART_INSTANCE USART_ID_1
7209  // Enable loopback, disable IrDA, disable auto baud detection and disable
7210  // wake from sleep. Enable stop in idle
7211  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
7212  false, false, true);
7213  </code>
7214  Remarks:
7215  Enabling the wake from sleep feature will cause the first character that is
7216  received by the USART module to be discarded. This feature should only be
7217  enabled if the CPU is to placed in power saving mode.
7218 
7219  This feature may not be available on all devices. Please refer to the
7220  specific device data sheet to determine availability. Availability of this
7221  function can also be determined if all of the following functions return
7222  true:
7223  - PLIB_USART_ExistsLoopback
7224  - PLIB_USART_ExistsBaudRateAutoDetect
7225  - PLIB_USART_ExistsWakeOnStart
7226  - PLIB_USART_ExistsIrDA
7227  - PLIB_USART_ExistsStopInIdle
7228 */
7229 
7230 void
7232  USART_MODULE_ID index ,
7233  bool autobaud ,
7234  bool loopBackMode ,
7235  bool wakeFromSleep ,
7236  bool irdaMode ,
7237  bool stopInIdle ) ;
7238 //******************************************************************************
7239 /* Function:
7240  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
7241  USART_RECEIVE_INTR_MODE receiveInterruptMode,
7242  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
7243  USART_OPERATION_MODE operationMode);
7244  Summary:
7245  Configures the Receive and Transmit FIFO interrupt levels and the hardware
7246  lines to be used by the module.
7247  Description:
7248  This function configures the Receive and Transmit FIFO interrupt levels and
7249  the hardware lines to be used by the module.
7250  Precondition:
7251  None.
7252  Parameters:
7253  index - Identifier for the device instance to be configured
7254  receiveInterruptMode - Receiver FIFO interrupt level
7255  transmitInterruptMode - Transmit FIFO interrupt level
7256  operationMode - Hardware lines to be used by the USART.
7257  Returns:
7258  None.
7259  Example:
7260  <code>
7261 #define MY_USART_INSTANCE USART_ID_1
7262  // Set receive FIFO to interrupt when FIFO is 3/4 level full
7263  // Set Transmit FIFO to interrupt when FIFO is empty
7264  // USART module will only use RX and TX hardware lines
7265  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
7266  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
7267  </code>
7268  Remarks:
7269  This feature may not be available on all devices. Please refer to the
7270  specific device data sheet to determine availability. Availability of this
7271  function can also be determined if all of the following functions return
7272  true:
7273  - PLIB_USART_ExistsReceiverInterruptMode
7274  - PLIB_USART_ExistsTransmitterInterruptMode
7275  - PLIB_USART_ExistsOperationMode
7276 */
7277 
7278 void
7280  USART_MODULE_ID index ,
7281  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
7282  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
7283  USART_OPERATION_MODE operationMode ) ;
7284 //******************************************************************************
7285 /* Function:
7286  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
7287  clockFrequency, uint32_t baudRate );
7288  Summary:
7289  Sets the baud rate to the desired value and enables the USART receiver,
7290  transmitter and the USART module.
7291  Description:
7292  This function sets the baud rate to the desired value and enables the USART
7293  receiver, USART transmitter and USART module.
7294  Precondition:
7295  None.
7296  Parameters:
7297  index - Identifier for the device instance to be configured
7298  baudRate - Baud Rate Value
7299  clockFrequency - Clock Frequency
7300  Returns:
7301  None.
7302  Example:
7303  <code>
7304 #define MY_USART_INSTANCE USART_ID_1
7305  uint32_t baudRateValue ;
7306  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
7307  </code>
7308  Remarks:
7309  Setting a new baud rate value causes the baud rate timer to reset.
7310  This ensures that the baud rate timer does not have to overflow before
7311  outputting the new baud rate.
7312 
7313  If the system clock is changed during an active receive operation, a
7314  receiver error or data loss may result. To avoid this issue verify that
7315  no receptions are in progress before changing the system clock.
7316 
7317  This feature may not be available on all devices. Please refer to the
7318  specific device data sheet to determine availability. Availability of this
7319  function can also be determined if all of the following functions return
7320  true:
7321  - PLIB_USART_ExistsBaudRate
7322  - PLIB_USART_ExistsTransmitterEnable
7323  - PLIB_USART_ExistsReceiverEnable
7324  - PLIB_USART_ExistsEnable
7325 */
7326 
7327 void
7329  USART_MODULE_ID index ,
7330  uint32_t systemClock ,
7331  uint32_t baud ) ;
7332 //******************************************************************************
7333 /* Function:
7334  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
7335  Summary:
7336  Return the status of all errors in the specified USART module.
7337  Description:
7338  This function returns status of all errors in the specified USART module.
7339  The return value can be bitwise AND'ed with a USART_ERROR type to know the
7340  status of a specific error.
7341  This operation is atomic.
7342  Precondition:
7343  None.
7344  Parameters:
7345  index - Identifier for the device instance to be configured
7346  Returns:
7347  Returns a bitmap of USART error status.
7348  Example:
7349  <code>
7350 #define MY_USART_INSTANCE USART_ID_1
7351  USART_ERROR error;
7352  // Get the status of all errors.
7353  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
7354  // Check if parity error is active
7355  if(error & USART_ERROR_PARITY)
7356  {
7357  // Parity error is active.
7358  }
7359  else if(error & USART_ERROR_FRAMING)
7360  {
7361  // Framing error is active.
7362  }
7363  </code>
7364  Remarks:
7365  This feature may not be available on all devices. Please refer to the
7366  specific device data sheet to determine availability. Availability of this
7367  function can also be determined if all of the followings functions return
7368  true:
7369  - PLIB_USART_ExistsReceiverFramingErrorStatus
7370  - PLIB_USART_ExistsReceiverParityErrorStatus
7371  - PLIB_USART_ExistsReceiverOverrunStatus
7372 */
7373 
7374 USART_ERROR
7376  USART_MODULE_ID index ) ;
7377 //******************************************************************************
7378 /* Function:
7379  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
7380  Summary:
7381  Returns the address of the USART TX register
7382  Description:
7383  This function returns the address of the USART TX register.
7384  This operation is atomic.
7385  Preconditions:
7386  None.
7387  Parameters:
7388  index - Identifier for the device instance
7389  Returns:
7390  Address of the USART TX register
7391  Remarks:
7392  None.
7393 */
7394 
7395 void *
7397  USART_MODULE_ID index ) ;
7398 //******************************************************************************
7399 /* Function:
7400  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
7401  Summary:
7402  Returns the address of the USART RX register
7403  Description:
7404  This function returns the address of the USART RX register.
7405  This operation is atomic.
7406  Preconditions:
7407  None.
7408  Parameters:
7409  index - Identifier for the device instance
7410  Returns:
7411  Address of the USART RX register
7412  Remarks:
7413  None.
7414 */
7415 
7416 void *
7418  USART_MODULE_ID index ) ;
7419 // *****************************************************************************
7420 // *****************************************************************************
7421 // Section: USART Peripheral Library Exists Functions
7422 // *****************************************************************************
7423 // *****************************************************************************
7424 /* The following functions indicate the existence of the features on the device.
7425 */
7426 //******************************************************************************
7427 /* Function:
7428  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
7429  Summary:
7430  Identifies whether the Run in overflow condition feature exists on the USART module.
7431  Description:
7432  This function identifies whether the Run in Overflow condition feature is
7433  available on the USART module. When this function returns true, these
7434  functions are supported on the device:
7435  - PLIB_USART_RunInOverflowEnable
7436  - PLIB_USART_RunInOverflowDisable
7437  - PLIB_USART_RunInOverflowIsEnabled
7438  This operation is atomic.
7439  Preconditions:
7440  None.
7441  Parameters:
7442  index - Identifier for the device instance
7443  Returns:
7444  - true - The Run in Overflow condition feature is supported on the device
7445  - false - The Run in Overflow condition feature is not supported on the device
7446  Remarks:
7447  None.
7448 */
7449 
7450 bool
7452  USART_MODULE_ID index ) ;
7453 //******************************************************************************
7454 /* Function:
7455  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
7456  Summary:
7457  Identifies whether the BRG Clock source select feature exists on the
7458  USART module.
7459  Description:
7460  This function identifies whether the BRG Clock source select feature is
7461  available on the USART module. When this function returns true, these
7462  functions are supported on the device:
7463  - PLIB_USART_BRGClockSourceSelect
7464  - PLIB_USART_BRGClockSourceGet
7465  This operation is atomic.
7466  Preconditions:
7467  None.
7468  Parameters:
7469  index - Identifier for the device instance
7470  Returns:
7471  - true - The BRG clock source select feature is supported on the device
7472  - false - The BRG clock source select feature is not supported on the device
7473  Remarks:
7474  None.
7475 */
7476 
7477 bool
7479  USART_MODULE_ID index ) ;
7480 //******************************************************************************
7481 /* Function:
7482  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
7483  Summary:
7484  Identifies whether the module running status feature exists on the
7485  USART module.
7486  Description:
7487  This function identifies whether the module running status feature is
7488  available on the USART module. When this function returns true, this
7489  function is supported on the device:
7490  - PLIB_USART_ModuleIsBusy
7491  This operation is atomic.
7492  Preconditions:
7493  None.
7494  Parameters:
7495  index - Identifier for the device instance
7496  Returns:
7497  - true - The Module running status feature is supported on the device
7498  - false - The Module running status feature is not supported on the device
7499  Remarks:
7500  None.
7501 */
7502 
7503 bool
7505  USART_MODULE_ID index ) ;
7506 //******************************************************************************
7507 /* Function:
7508  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
7509  Summary:
7510  Identifies whether the Run in Sleep mode feature exists on the USART module.
7511  Description:
7512  This function identifies whether the Run in Sleep mode feature is
7513  available on the USART module. When this function returns true, these
7514  functions are supported on the device:
7515  - PLIB_USART_RunInSleepModeEnable
7516  - PLIB_USART_RunInSleepModeDisable
7517  - PLIB_USART_RunInSleepModeIsEnabled
7518  This operation is atomic.
7519  Preconditions:
7520  None.
7521  Parameters:
7522  index - Identifier for the device instance
7523  Returns:
7524  - true - The Run in Sleep mode feature is supported on the device
7525  - false - The Run in Sleep mode feature is not supported on the device
7526  Remarks:
7527  None.
7528 */
7529 
7530 bool
7532  USART_MODULE_ID index ) ;
7533 //******************************************************************************
7534 /* Function:
7535  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
7536  Summary:
7537  Identifies whether the EnableControl feature exists on the USART module.
7538  Description:
7539  This function identifies whether the EnableControl feature is
7540  available on the USART module. When this function returns true, these
7541  functions are supported on the device:
7542  - PLIB_USART_Disable
7543  - PLIB_USART_Enable
7544  This operation is atomic.
7545  Preconditions:
7546  None.
7547  Parameters:
7548  index - Identifier for the device instance
7549  Returns:
7550  - true - The EnableControl feature is supported on the device
7551  - false - The EnableControl feature is not supported on the device
7552  Remarks:
7553  None.
7554 */
7555 
7556 bool
7558  USART_MODULE_ID index ) ;
7559 //******************************************************************************
7560 /* Function:
7561  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7562  Summary:
7563  Identifies whether the HandShakeMode feature exists on the USART module.
7564  Description:
7565  This function identifies whether the HandShakeMode feature is
7566  available on the USART module. When this function returns true, this
7567  function is supported on the device:
7568  - PLIB_USART_HandshakeModeSelect
7569  This operation is atomic.
7570  Preconditions:
7571  None.
7572  Parameters:
7573  index - Identifier for the device instance
7574  Returns:
7575  - true - The HandShakeMode feature is supported on the device
7576  - false - The HandShakeMode feature is not supported on the device
7577  Remarks:
7578  None.
7579 */
7580 
7581 bool
7583  USART_MODULE_ID index ) ;
7584 //******************************************************************************
7585 /* Function:
7586  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7587  Summary:
7588  Identifies whether the IrDAControl feature exists on the USART module.
7589  Description:
7590  This function identifies whether the IrDAControl feature is
7591  available on the USART module. When this function returns true, these
7592  functions are supported on the device:
7593  - PLIB_USART_IrDADisable
7594  - PLIB_USART_IrDAEnable
7595  This operation is atomic.
7596  Preconditions:
7597  None.
7598  Parameters:
7599  index - Identifier for the device instance
7600  Returns:
7601  - true - The IrDAControl feature is supported on the device
7602  - false - The IrDAControl feature is not supported on the device
7603  Remarks:
7604  None.
7605 */
7606 
7607 bool
7609  USART_MODULE_ID index ) ;
7610 //******************************************************************************
7611 /* Function:
7612  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7613  Summary:
7614  Identifies whether the LineControlMode feature exists on the USART module.
7615  Description:
7616  This function identifies whether the LineControlMode feature is
7617  available on the USART module. When this function returns true, this
7618  function is supported on the device:
7619  - PLIB_USART_LineControlModeSelect
7620  This operation is atomic.
7621  Preconditions:
7622  None.
7623  Parameters:
7624  index - Identifier for the device instance
7625  Returns:
7626  - true - The LineControlMode feature is supported on the device
7627  - false - The LineControlMode feature is not supported on the device
7628  Remarks:
7629  None.
7630 */
7631 
7632 bool
7634  USART_MODULE_ID index ) ;
7635 //******************************************************************************
7636 /* Function:
7637  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7638  Summary:
7639  Identifies whether the Loopback feature exists on the USART module.
7640  Description:
7641  This function identifies whether the Loopback feature is
7642  available on the USART module. When this function returns true, these
7643  functions are supported on the device:
7644  - PLIB_USART_LoopbackEnable
7645  - PLIB_USART_LoopbackDisable
7646  This operation is atomic.
7647  Preconditions:
7648  None.
7649  Parameters:
7650  index - Identifier for the device instance
7651  Returns:
7652  - true - The Loopback feature is supported on the device
7653  - false - The Loopback feature is not supported on the device
7654  Remarks:
7655  None.
7656 */
7657 
7658 bool
7660  USART_MODULE_ID index ) ;
7661 //******************************************************************************
7662 /* Function:
7663  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7664  Summary:
7665  Identifies whether the OperationMode feature exists on the USART module.
7666  Description:
7667  This function identifies whether the OperationMode feature is
7668  available on the USART module. When this function returns true, this
7669  function is supported on the device:
7670  - PLIB_USART_OperationModeSelect
7671  This operation is atomic.
7672  Preconditions:
7673  None.
7674  Parameters:
7675  index - Identifier for the device instance
7676  Returns:
7677  - true - The OperationMode feature is supported on the device
7678  - false - The OperationMode feature is not supported on the device
7679  Remarks:
7680  None.
7681 */
7682 
7683 bool
7685  USART_MODULE_ID index ) ;
7686 //******************************************************************************
7687 /* Function:
7688  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7689  Summary:
7690  Identifies whether the StopInIdle feature exists on the USART module.
7691  Description:
7692  This function identifies whether the StopInIdle feature is
7693  available on the USART module. When this function returns true, these
7694  functions are supported on the device:
7695  - PLIB_USART_StopInIdleEnable
7696  - PLIB_USART_StopInIdleDisable
7697  This operation is atomic.
7698  Preconditions:
7699  None.
7700  Parameters:
7701  index - Identifier for the device instance
7702  Returns:
7703  - true - The StopInIdle feature is supported on the device
7704  - false - The StopInIdle feature is not supported on the device
7705  Remarks:
7706  None.
7707 */
7708 
7709 bool
7711  USART_MODULE_ID index ) ;
7712 //******************************************************************************
7713 /* Function:
7714  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7715  Summary:
7716  Identifies whether the WakeOnStart feature exists on the USART module.
7717  Description:
7718  This function identifies whether the WakeOnStart feature is
7719  available on the USART module. When this function returns true, these
7720  functions are supported on the device:
7721  - PLIB_USART_WakeOnStartEnable
7722  - PLIB_USART_WakeOnStartDisable
7723  - PLIB_USART_WakeOnStartIsEnabled
7724  This operation is atomic.
7725  Preconditions:
7726  None.
7727  Parameters:
7728  index - Identifier for the device instance
7729  Returns:
7730  - true - The WakeOnStart feature is supported on the device
7731  - false - The WakeOnStart feature is not supported on the device
7732  Remarks:
7733  None.
7734 */
7735 
7736 bool
7738  USART_MODULE_ID index ) ;
7739 //******************************************************************************
7740 /* Function:
7741  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7742  Summary:
7743  Identifies whether the BaudRate feature exists on the USART module.
7744  Description:
7745  This function identifies whether the BaudRate feature is
7746  available on the USART module. When this function returns true, these
7747  functions are supported on the device:
7748  - PLIB_USART_BaudRateSet
7749  - PLIB_USART_BaudRateGet
7750  This operation is atomic.
7751  Preconditions:
7752  None.
7753  Parameters:
7754  index - Identifier for the device instance
7755  Returns:
7756  - true - The BaudRate feature is supported on the device
7757  - false - The BaudRate feature is not supported on the device
7758  Remarks:
7759  None.
7760 */
7761 
7762 bool
7764  USART_MODULE_ID index ) ;
7765 //******************************************************************************
7766 /* Function:
7767  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7768  Summary:
7769  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7770  Description:
7771  This function identifies whether the BaudRateAutoDetect feature is
7772  available on the USART module. When this function returns true, these
7773  functions are supported on the device:
7774  - PLIB_USART_BaudRateAutoDetectEnable
7775  - PLIB_USART_BaudRateAutoDetectIsComplete
7776  This operation is atomic.
7777  Preconditions:
7778  None.
7779  Parameters:
7780  index - Identifier for the device instance
7781  Returns:
7782  - true - The BaudRateAutoDetect feature is supported on the device
7783  - false - The BaudRateAutoDetect feature is not supported on the device
7784  Remarks:
7785  None.
7786 */
7787 
7788 bool
7790  USART_MODULE_ID index ) ;
7791 //******************************************************************************
7792 /* Function:
7793  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7794  Summary:
7795  Identifies whether the BaudRateHigh feature exists on the USART module.
7796  Description:
7797  This function identifies whether the BaudRateHigh feature is
7798  available on the USART module. When this function returns true, these
7799  functions are supported on the device:
7800  - PLIB_USART_BaudRateHighSet
7801  - PLIB_USART_BaudRateHighDisable
7802  - PLIB_USART_BaudRateHighEnable
7803  This operation is atomic.
7804  Preconditions:
7805  None.
7806  Parameters:
7807  index - Identifier for the device instance
7808  Returns:
7809  - true - The BaudRateHigh feature is supported on the device
7810  - false - The BaudRateHigh feature is not supported on the device
7811  Remarks:
7812  None.
7813 */
7814 
7815 bool
7817  USART_MODULE_ID index ) ;
7818 //******************************************************************************
7819 /* Function:
7820  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7821  Summary:
7822  Identifies whether the Receiver Address feature exists on the USART
7823  module.
7824  Description:
7825  This function identifies whether the Receiver Address feature is
7826  available on the USART module. When this function returns true, these
7827  functions are supported on the device:
7828  - PLIB_USART_AddressSet
7829  - PLIB_USART_AddressGet
7830  This operation is atomic.
7831  Preconditions:
7832  None.
7833  Parameters:
7834  index - Identifier for the device instance
7835  Returns:
7836  - true - The Receiver address feature is supported on the device
7837  - false - The Receiver address feature is not supported on the device
7838  Remarks:
7839  None.
7840 */
7841 
7842 bool
7844  USART_MODULE_ID index ) ;
7845 //******************************************************************************
7846 /* Function:
7847  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7848  Summary:
7849  Identifies whether the Receiver Address Mask feature exists on the USART
7850  module.
7851  Description:
7852  This function identifies whether the Receiver Address Mask feature is
7853  available on the USART module. When this function returns true, these
7854  functions are supported on the device:
7855  - PLIB_USART_AddressMaskSet
7856  - PLIB_USART_AddressMaskGet
7857  This operation is atomic.
7858  Preconditions:
7859  None.
7860  Parameters:
7861  index - Identifier for the device instance
7862  Returns:
7863  - true - The Receiver address mask feature is supported on the device
7864  - false - The Receiver address mask feature is not supported on the device
7865  Remarks:
7866  None.
7867 */
7868 
7869 bool
7871  USART_MODULE_ID index ) ;
7872 //******************************************************************************
7873 /* Function:
7874  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7875  Summary:
7876  Identifies whether the Receiver feature exists on the USART module.
7877  Description:
7878  This function identifies whether the Receiver feature is available on the
7879  USART module. When this function returns true, these functions are supported
7880  on the device:
7881  - PLIB_USART_ReceiverByteReceive
7882  - PLIB_USART_ReceiverAddressGet
7883  This operation is atomic.
7884  Preconditions:
7885  None.
7886  Parameters:
7887  index - Identifier for the device instance
7888  Returns:
7889  - true - The Receiver feature is supported on the device
7890  - false - The Receiver feature is not supported on the device
7891  Remarks:
7892  None.
7893 */
7894 
7895 bool
7897  USART_MODULE_ID index ) ;
7898 //******************************************************************************
7899 /* Function:
7900  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7901  Summary:
7902  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7903  Description:
7904  This function identifies whether the 9 Bits Receiver feature is available on the
7905  USART module. When this function returns true, this function is supported
7906  on the device:
7907  - PLIB_USART_Receiver9BitsReceive
7908  This operation is atomic.
7909  Preconditions:
7910  None.
7911  Parameters:
7912  index - Identifier for the device instance
7913  Returns:
7914  - true - The feature is supported on the device
7915  - false - The feature is not supported on the device
7916  Remarks:
7917  None.
7918 */
7919 
7920 bool
7922  USART_MODULE_ID index ) ;
7923 //******************************************************************************
7924 /* Function:
7925  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7926  Summary:
7927  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7928  Description:
7929  This function identifies whether the ReceiverAddressAutoDetect feature is
7930  available on the USART module. When this function returns true, these
7931  functions are supported on the device:
7932  - PLIB_USART_ReceiverAddressAutoDetectEnable
7933  - PLIB_USART_ReceiverAddressAutoDetectDisable
7934  This operation is atomic.
7935  Preconditions:
7936  None.
7937  Parameters:
7938  index - Identifier for the device instance
7939  Returns:
7940  - true - The ReceiverAddressAutoDetect feature is supported on the device
7941  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7942  Remarks:
7943  None.
7944 */
7945 
7946 bool
7948  USART_MODULE_ID index ) ;
7949 //******************************************************************************
7950 /* Function:
7951  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7952  Summary:
7953  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7954  Description:
7955  This function identifies whether the ReceiverAddressDetect feature is
7956  available on the USART module. When this function returns true, these
7957  functions are supported on the device:
7958  - PLIB_USART_ReceiverAddressDetectEnable
7959  - PLIB_USART_ReceiverAddressDetectDisable
7960  - PLIB_USART_ReceiverAddressIsReceived
7961  This operation is atomic.
7962  Preconditions:
7963  None.
7964  Parameters:
7965  index - Identifier for the device instance
7966  Returns:
7967  - true - The ReceiverAddressDetect feature is supported on the device
7968  - false - The ReceiverAddressDetect feature is not supported on the device
7969  Remarks:
7970  None.
7971 */
7972 
7973 bool
7975  USART_MODULE_ID index ) ;
7976 //******************************************************************************
7977 /* Function:
7978  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7979  Summary:
7980  Identifies whether the ReceiverDataAvailable feature exists on the USART
7981  module
7982  Description:
7983  This function identifies whether the ReceiverDataAvailable feature is
7984  available on the USART module. When this function returns true, this
7985  function is supported on the device:
7986  - PLIB_USART_ReceiverDataIsAvailable
7987  This operation is atomic.
7988  Preconditions:
7989  None.
7990  Parameters:
7991  index - Identifier for the device instance
7992  Returns:
7993  - true - The ReceiverDataAvailable feature is supported on the device
7994  - false - The ReceiverDataAvailable feature is not supported on the device
7995  Remarks:
7996  None.
7997 */
7998 
7999 bool
8001  USART_MODULE_ID index ) ;
8002 //******************************************************************************
8003 /* Function:
8004  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
8005  Summary:
8006  Identifies whether the ReceiverEnableControl feature exists on the USART module.
8007  Description:
8008  This function identifies whether the ReceiverEnableControl feature is
8009  available on the USART module. When this function returns true, these
8010  functions are supported on the device:
8011  - PLIB_USART_ReceiverEnable
8012  - PLIB_USART_ReceiverDisable
8013  This operation is atomic.
8014  Preconditions:
8015  None.
8016  Parameters:
8017  index - Identifier for the device instance
8018  Returns:
8019  - true - The ReceiverEnableControl feature is supported on the device
8020  - false - The ReceiverEnableControl feature is not supported on the device
8021  Remarks:
8022  None.
8023 */
8024 
8025 bool
8027  USART_MODULE_ID index ) ;
8028 //******************************************************************************
8029 /* Function:
8030  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
8031  Summary:
8032  Identifies whether the ReceiverIdle feature exists on the USART module.
8033  Description:
8034  This function identifies whether the ReceiverIdle feature is
8035  available on the USART module. When this function returns true, this
8036  function is supported on the device:
8037  - PLIB_USART_ReceiverIsIdle
8038  This operation is atomic.
8039  Preconditions:
8040  None.
8041  Parameters:
8042  index - Identifier for the device instance
8043  Returns:
8044  - true - The ReceiverIdle feature is supported on the device
8045  - false - The ReceiverIdle feature is not supported on the device
8046  Remarks:
8047  None.
8048 */
8049 
8050 bool
8052  USART_MODULE_ID index ) ;
8053 //******************************************************************************
8054 /* Function:
8055  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
8056  Summary:
8057  Identifies whether the ReceiverFramingError feature exists on the USART module.
8058  Description:
8059  This function identifies whether the ReceiverFramingError feature is
8060  available on the USART module. When this function returns true, this
8061  function is supported on the device:
8062  - PLIB_USART_ReceiverFramingErrorHasOccurred
8063  This operation is atomic.
8064  Preconditions:
8065  None.
8066  Parameters:
8067  index - Identifier for the device instance
8068  Returns:
8069  - true - The ReceiverFramingError feature is supported on the device
8070  - false - The ReceiverFramingError feature is not supported on the device
8071  Remarks:
8072  None.
8073 */
8074 
8075 bool
8077  USART_MODULE_ID index ) ;
8078 //******************************************************************************
8079 /* Function:
8080  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
8081  Summary:
8082  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
8083  Description:
8084  This function identifies whether the ReceiverInterruptMode feature is
8085  available on the USART module. When this function returns true, this
8086  function is supported on the device:
8087  - PLIB_USART_ReceiverInterruptModeSelect
8088  This operation is atomic.
8089  Preconditions:
8090  None.
8091  Parameters:
8092  index - Identifier for the device instance
8093  Returns:
8094  - true - The ReceiverInterruptMode feature is supported on the device
8095  - false - The ReceiverInterruptMode feature is not supported on the device
8096  Remarks:
8097  None.
8098 */
8099 
8100 bool
8102  USART_MODULE_ID index ) ;
8103 //******************************************************************************
8104 /* Function:
8105  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
8106  Summary:
8107  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
8108  Description:
8109  This function identifies whether the ReceiverPolarityInvert feature is
8110  available on the USART module. When this function returns true, these
8111  functions are supported on the device:
8112  - PLIB_USART_ReceiverIdleStateLowEnable
8113  - PLIB_USART_ReceiverIdleStateLowDisable
8114  This operation is atomic.
8115  Preconditions:
8116  None.
8117  Parameters:
8118  index - Identifier for the device instance
8119  Returns:
8120  - true - The ReceiverPolarityInvert feature is supported on the device
8121  - false - The ReceiverPolarityInvert feature is not supported on the device
8122  Remarks:
8123  None.
8124 */
8125 
8126 bool
8128  USART_MODULE_ID index ) ;
8129 //******************************************************************************
8130 /* Function:
8131  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
8132  Summary:
8133  Identifies whether the ReceiverParityError feature exists on the USART module.
8134  Description:
8135  This function identifies whether the ReceiverParityError feature is
8136  available on the USART module. When this function returns true, this
8137  function is supported on the device:
8138  - PLIB_USART_ReceiverParityErrorHasOccurred
8139  This operation is atomic.
8140  Preconditions:
8141  None.
8142  Parameters:
8143  index - Identifier for the device instance
8144  Returns:
8145  - true - The ReceiverParityError feature is supported on the device
8146  - false - The ReceiverParityError feature is not supported on the device
8147  Remarks:
8148  None.
8149 */
8150 
8151 bool
8153  USART_MODULE_ID index ) ;
8154 //******************************************************************************
8155 /* Function:
8156  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
8157  Summary:
8158  Identifies whether the ReceiverOverrunError feature exists on the USART module.
8159  Description:
8160  This function identifies whether the ReceiverOverrunError feature is
8161  available on the USART module. When this function returns true, these
8162  functions are supported on the device:
8163  - PLIB_USART_ReceiverOverrunErrorClear
8164  - PLIB_USART_ReceiverOverrunHasOccurred
8165  This operation is atomic.
8166  Preconditions:
8167  None.
8168  Parameters:
8169  index - Identifier for the device instance
8170  Returns:
8171  - true - The ReceiverOverrunError feature is supported on the device
8172  - false - The ReceiverOverrunError feature is not supported on the device
8173  Remarks:
8174  None.
8175 */
8176 
8177 bool
8179  USART_MODULE_ID index ) ;
8180 //******************************************************************************
8181 /* Function:
8182  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
8183  Summary:
8184  Identifies whether the Transmitter feature exists on the USART module.
8185  Description:
8186  This function identifies whether the Transmitter feature is
8187  available on the USART module. When this function returns true, these
8188  functions are supported on the device:
8189  - PLIB_USART_TransmitterByteSend
8190  - PLIB_USART_TransmitterAddressGet
8191  This operation is atomic.
8192  Preconditions:
8193  None.
8194  Parameters:
8195  index - Identifier for the device instance
8196  Returns:
8197  - true - The Transmitter feature is supported on the device
8198  - false - The Transmitter feature is not supported on the device
8199  Remarks:
8200  None.
8201 */
8202 
8203 bool
8205  USART_MODULE_ID index ) ;
8206 //******************************************************************************
8207 /* Function:
8208  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
8209  Summary:
8210  Identifies whether the Transmitter9Bits feature exists on the USART module.
8211  Description:
8212  This function identifies whether the Transmitter9Bits feature is
8213  available on the USART module. When this function returns true, this
8214  function is supported on the device:
8215  - PLIB_USART_Transmitter9BitsSend
8216  This operation is atomic.
8217  Preconditions:
8218  None.
8219  Parameters:
8220  index - Identifier for the device instance
8221  Returns:
8222  - true - The Transmitter9Bits feature is supported on the device
8223  - false - The Transmitter9Bits feature is not supported on the device
8224  Remarks:
8225  None.
8226 */
8227 
8228 bool
8230  USART_MODULE_ID index ) ;
8231 //******************************************************************************
8232 /* Function:
8233  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
8234  Summary:
8235  Identifies whether the TransmitterBreak feature exists on the USART module.
8236  Description:
8237  This function identifies whether the TransmitterBreak feature is
8238  available on the USART module. When this function returns true, these
8239  functions are supported on the device:
8240  - PLIB_USART_TransmitterBreakSend
8241  - PLIB_USART_TransmitterBreakSendIsComplete
8242  This operation is atomic.
8243  Preconditions:
8244  None.
8245  Parameters:
8246  index - Identifier for the device instance
8247  Returns:
8248  - true - The TransmitterBreak feature is supported on the device
8249  - false - The TransmitterBreak feature is not supported on the device
8250  Remarks:
8251  None.
8252 */
8253 
8254 bool
8256  USART_MODULE_ID index ) ;
8257 //******************************************************************************
8258 /* Function:
8259  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
8260  Summary:
8261  Identifies whether the TransmitterBufferFull feature exists on the USART module.
8262  Description:
8263  This function identifies whether the TransmitterBufferFull feature is
8264  available on the USART module. When this function returns true, this
8265  function is supported on the device:
8266  - PLIB_USART_TransmitterBufferIsFull
8267  This operation is atomic.
8268  Preconditions:
8269  None.
8270  Parameters:
8271  index - Identifier for the device instance
8272  Returns:
8273  - true - The TransmitterBufferFull feature is supported on the device
8274  - false - The TransmitterBufferFull feature is not supported on the device
8275  Remarks:
8276  None.
8277 */
8278 
8279 bool
8281  USART_MODULE_ID index ) ;
8282 //******************************************************************************
8283 /* Function:
8284  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
8285  Summary:
8286  Identifies whether the TransmitterEmpty feature exists on the USART module.
8287  Description:
8288  This function identifies whether the TransmitterEmpty feature is
8289  available on the USART module. When this function returns true, this
8290  function is supported on the device:
8291  - PLIB_USART_TransmitterIsEmpty
8292  This operation is atomic.
8293  Preconditions:
8294  None.
8295  Parameters:
8296  index - Identifier for the device instance
8297  Returns:
8298  - true - The TransmitterEmpty feature is supported on the device
8299  - false - The TransmitterEmpty feature is not supported on the device
8300  Remarks:
8301  None.
8302 */
8303 
8304 bool
8306  USART_MODULE_ID index ) ;
8307 //******************************************************************************
8308 /* Function:
8309  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
8310  Summary:
8311  Identifies whether the TransmitterEnableControl feature exists on the USART
8312  module
8313  Description:
8314  This function identifies whether the TransmitterEnableControl feature is
8315  available on the USART module. When this function returns true, these
8316  functions are supported on the device:
8317  - PLIB_USART_TransmitterEnable
8318  - PLIB_USART_TransmitterDisable
8319  This operation is atomic.
8320  Preconditions:
8321  None.
8322  Parameters:
8323  index - Identifier for the device instance
8324  Returns:
8325  - true - The TransmitterEnableControl feature is supported on the device
8326  - false - The TransmitterEnableControl feature is not supported on the device
8327  Remarks:
8328  None.
8329 */
8330 
8331 bool
8333  USART_MODULE_ID index ) ;
8334 //******************************************************************************
8335 /* Function:
8336  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
8337  Summary:
8338  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
8339  Description:
8340  This function identifies whether the TransmitterInterruptMode feature is
8341  available on the USART module. When this function returns true, this function
8342  is supported on the device:
8343  - PLIB_USART_TransmitterInterruptModeSelect
8344  This operation is atomic.
8345  Preconditions:
8346  None.
8347  Parameters:
8348  index - Identifier for the device instance
8349  Returns:
8350  - true - The TransmitterInterruptMode feature is supported on the device
8351  - false - The TransmitterInterruptMode feature is not supported on the device
8352  Remarks:
8353  None.
8354 */
8355 
8356 bool
8358  USART_MODULE_ID index ) ;
8359 //******************************************************************************
8360 /* Function:
8361  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
8362  Summary:
8363  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
8364  Description:
8365  This function identifies whether the TransmitterIdleIsLow feature is available
8366  on the USART module. When this function returns true, these functions are
8367  supported on the device:
8368  - PLIB_USART_TransmitterIdleIsLowDisable
8369  - PLIB_USART_TransmitterIdleIsLowEnable
8370  This operation is atomic.
8371  Preconditions:
8372  None.
8373  Parameters:
8374  index - Identifier for the device instance
8375  Returns:
8376  - true - The TransmitterIdleIsLow feature is supported on the device
8377  - false - The TransmitterIdleIsLow feature is not supported on the device
8378  Remarks:
8379  None.
8380 */
8381 
8382 bool
8384  USART_MODULE_ID index ) ;
8385 //DOM-IGNORE-BEGIN
8386 //DOM-IGNORE-END
8387  // #ifndef _PLIB_USART_H
8388 /******************************************************************************
8389  End of File
8390 */
8391 
8392 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
8393 /* CLOSE_FILE Include File */
8394 
8395 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
8396 /*******************************************************************************
8397  System Services Library Interface Header
8398  Company:
8399  Microchip Technology Inc.
8400  File Name:
8401  system.h
8402  Summary:
8403  Top level common system services library interface header.
8404  Description:
8405  This file is the top level common system services library interface header.
8406  It defines (or includes files that define) the common system service
8407  types, prototypes, and other definitions that are commonly used by MPLAB
8408  Harmony libraries and system services.
8409 
8410  System services provide common functionality that would otherwise need to
8411  be duplicated by multiple other modules or that would force them to
8412  interact in complex and hard to manage ways. System services eliminate
8413  conflicts by controlling access shared resources.
8414  Remarks:
8415  The parent directory to the "system" directory should be added to the
8416  compiler's search path for header files such that the following include
8417  statment will successfully include this file.
8418 
8419 #include "system/system.h"
8420  *******************************************************************************/
8421 //DOM-IGNORE-BEGIN
8422 /*******************************************************************************
8423 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
8424 Microchip licenses to you the right to use, modify, copy and distribute
8425 Software only when embedded on a Microchip microcontroller or digital signal
8426 controller that is integrated into your product or third party product
8427 (pursuant to the sublicense terms in the accompanying license agreement).
8428 You should refer to the license agreement accompanying this Software for
8429 additional information regarding your rights and obligations.
8430 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8431 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8432 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8433 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8434 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8435 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8436 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8437 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8438 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8439 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8440  *******************************************************************************/
8441 //DOM-IGNORE-END
8442 #ifndef _SYSTEM_H
8443 #define _SYSTEM_H
8444 // *****************************************************************************
8445 // *****************************************************************************
8446 // Section: Included Files
8447 // *****************************************************************************
8448 // *****************************************************************************
8449 #include "system/common/sys_common.h"
8450 #include "system/common/sys_module.h"
8451 // DOM-IGNORE-BEGIN
8452 // DOM-IGNORE-END
8453 //DOM-IGNORE-BEGIN
8454 //DOM-IGNORE-END
8455  // _SYSTEM_H
8456 /*******************************************************************************
8457  End of File
8458 */
8459 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
8460 /* CLOSE_FILE Include File */
8461 
8462 #include "system/int/sys_int.h"
8463 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
8464 /*******************************************************************************
8465  DMA System Service Library Interface Definition
8466  Company:
8467  Microchip Technology Inc.
8468  File Name:
8469  sys_dma.h
8470  Summary:
8471  DMA System Service.
8472  Description:
8473  This file contains the interface definition for the DMA System
8474  Service. It provides a way to interact with the DMA subsystem to
8475  manage the data transfer between different peripherals and/or memory
8476  without intervention from the CPU.
8477 *******************************************************************************/
8478 //DOM-IGNORE-BEGIN
8479 /*******************************************************************************
8480 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8481 Microchip licenses to you the right to use, modify, copy and distribute
8482 Software only when embedded on a Microchip microcontroller or digital signal
8483 controller that is integrated into your product or third party product
8484 (pursuant to the sublicense terms in the accompanying license agreement).
8485 You should refer to the license agreement accompanying this Software for
8486 additional information regarding your rights and obligations.
8487 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8488 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8489 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8490 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8491 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8492 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8493 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8494 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8495 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8496 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8497 *******************************************************************************/
8498 //DOM-IGNORE-END
8499 #ifndef _SYS_DMA_H
8500 #define _SYS_DMA_H
8501 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
8502 /*******************************************************************************
8503  DMA System Service Library Interface Definition
8504  Company:
8505  Microchip Technology Inc.
8506  File Name:
8507  sys_dma_definitions.h
8508  Summary:
8509  DMA System Service data type definitions header.
8510  Description:
8511  This file contains data type definitions header.
8512 *******************************************************************************/
8513 //DOM-IGNORE-BEGIN
8514 /*******************************************************************************
8515 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8516 Microchip licenses to you the right to use, modify, copy and distribute
8517 Software only when embedded on a Microchip microcontroller or digital signal
8518 controller that is integrated into your product or third party product
8519 (pursuant to the sublicense terms in the accompanying license agreement).
8520 You should refer to the license agreement accompanying this Software for
8521 additional information regarding your rights and obligations.
8522 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8523 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8524 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8525 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8526 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8527 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8528 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8529 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8530 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8531 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8532 *******************************************************************************/
8533 //DOM-IGNORE-END
8534 #ifndef _SYS_DMA_DEFINITIONS_H
8535 #define _SYS_DMA_DEFINITIONS_H
8536 // *****************************************************************************
8537 // *****************************************************************************
8538 // Section: File includes
8539 // *****************************************************************************
8540 // *****************************************************************************
8541 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
8542 #include "system/common/sys_common.h"
8543 #include "system/common/sys_module.h"
8544 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
8545 /*******************************************************************************
8546  DMA Peripheral Library Interface Header
8547  Company:
8548  Microchip Technology Inc.
8549  File Name:
8550  plib_dma.h
8551  Summary:
8552  Defines the DMA Peripheral Library interface functions.
8553  Description:
8554  This header file contains the function prototypes and definitions of
8555  the data types and constants that make up the interface to the Direct Memory
8556  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8557  definitions in this file are for the DMA module.
8558 *******************************************************************************/
8559 // DOM-IGNORE-BEGIN
8560 /*******************************************************************************
8561 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8562 Microchip licenses to you the right to use, modify, copy and distribute
8563 Software only when embedded on a Microchip microcontroller or digital signal
8564 controller that is integrated into your product or third party product
8565 (pursuant to the sublicense terms in the accompanying license agreement).
8566 You should refer to the license agreement accompanying this Software for
8567 additional information regarding your rights and obligations.
8568 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8569 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8570 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8571 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8572 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8573 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8574 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8575 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8576 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8577 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8578 *******************************************************************************/
8579 // DOM-IGNORE-END
8580 #ifndef _PLIB_DMA_H
8581 #define _PLIB_DMA_H
8582 // DOM-IGNORE-BEGIN
8583 // DOM-IGNORE-END
8584 // *****************************************************************************
8585 // *****************************************************************************
8586 // Section: Includes
8587 // *****************************************************************************
8588 // *****************************************************************************
8589 /* See Bottom of file for implementation header include files.
8590 */
8591 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8592 //DOM-IGNORE-BEGIN
8593 /*******************************************************************************
8594 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8595 Microchip licenses to you the right to use, modify, copy and distribute
8596 Software only when embedded on a Microchip microcontroller or digital signal
8597 controller that is integrated into your product or third party product
8598 (pursuant to the sublicense terms in the accompanying license agreement).
8599 You should refer to the license agreement accompanying this Software for
8600 additional information regarding your rights and obligations.
8601 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8602 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8603 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8604 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8605 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8606 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8607 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8608 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8609 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8610 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8611  *******************************************************************************/
8612 //DOM-IGNORE-END
8613 #ifndef _PLIB_DMA_PROCESSOR_H
8614 #define _PLIB_DMA_PROCESSOR_H
8615 #error "Can't find header"
8616 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8617 /* CLOSE_FILE Include File */
8618 
8619 // *****************************************************************************
8620 // *****************************************************************************
8621 // Section: Peripheral Library Interface Functions
8622 // *****************************************************************************
8623 // *****************************************************************************
8624 // *****************************************************************************
8625 // *****************************************************************************
8626 // Section: DMA Channel Status Functions
8627 // *****************************************************************************
8628 // *****************************************************************************
8629 //******************************************************************************
8630 /* Function:
8631  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8632  DMA_CHANNEL channel )
8633  Summary:
8634  Returns the buffered data write status for the specified channel.
8635  Description:
8636  This function returns the buffered data write status for the specified channel.
8637  Precondition:
8638  None.
8639  Parameters:
8640  channel - One of the existing DMA channels listed by DMA_CHANNEL
8641  Returns:
8642  - true - The content of the DMA buffer has not been written to the location
8643  specified in the destination/source address or in Null Write mode
8644  - false - The content of the DMA buffer has been written to the location
8645  specified in the destination/source address or in Null Write mode
8646  Example:
8647  <code>
8648  bool chBuffWriteStatus;
8649  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8650  DMA_CHANNEL_3 );
8651  </code>
8652  Remarks:
8653  This feature is not available on all devices. Please refer to the specific device
8654  data sheet to determine availability.
8655 */
8656 
8657 bool
8659  DMA_MODULE_ID index ,
8660  DMA_CHANNEL channel ) ;
8661 /*******************************************************************************
8662  Function:
8663  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8664  DMA_CHANNEL channel,
8665  DMA_CHANNEL_COLLISION collisonType )
8666  Summary:
8667  Returns the status of the specified collision type for the specified channel.
8668  Description:
8669  This function returns the status of the specified collision type for the
8670  specified channel.
8671  Precondition:
8672  None.
8673  Parameters:
8674  channel - One of the existing DMA channels listed by DMA_CHANNEL
8675  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8676  Returns:
8677  - true - A collision specified by collisonType was detected
8678  - false - No collision of type collisonType was detected
8679  Example:
8680  <code>
8681  bool memWriteCollisionStatus;
8682  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8683  DMA_ID_0,
8684  DMA_CHANNEL_3,
8685  DMA_CHANNEL_COLLISION_MEMORY );
8686  </code>
8687  Remarks:
8688  This feature is not available on all devices. Please refer to the specific
8689  device data sheet to determine availability.
8690 */
8691 
8692 bool
8694  DMA_MODULE_ID index ,
8695  DMA_CHANNEL channel ,
8696  DMA_CHANNEL_COLLISION collisonType ) ;
8697 //******************************************************************************
8698 /* Function:
8699  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8700  DMA_CHANNEL channel )
8701  Summary:
8702  Returns the Ping-Pong mode status for the specified channel.
8703  Description:
8704  This function returns the Ping-Pong mode status for the specified channel.
8705  Precondition:
8706  None.
8707  Parameters:
8708  channel - One of the existing DMA channels listed by DMA_CHANNEL
8709  Returns:
8710  mode - One of the possible Ping-Pong modes
8711  Example:
8712  <code>
8713  DMA_PING_PONG_MODE chPingPongStatus;
8714  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8715  DMA_CHANNEL_3 );
8716  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8717  {
8718  \\Application
8719  }
8720  </code>
8721  Remarks:
8722  This feature is not available on all devices. Please refer to the specific
8723  device data sheet to determine availability.
8724 */
8725 
8726 DMA_PING_PONG_MODE
8728  DMA_MODULE_ID index ,
8729  DMA_CHANNEL channel ) ;
8730 //******************************************************************************
8731 /* Function:
8732  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8733  DMA_CHANNEL channel )
8734  Summary:
8735  Returns the event status on the specified channel.
8736  Description:
8737  This function returns the event status on the specified channel.
8738  Precondition:
8739  None.
8740  Parameters:
8741  channel - One of the possible DMA channels listed by DMA_CHANNEL
8742  Returns:
8743  - true - An event was detected
8744  - false - No events were detected
8745  Example:
8746  <code>
8747  bool channeleventStatus;
8748  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8749  DMA_CHANNEL_2 );
8750  </code>
8751  Remarks:
8752  This function implements an operation of the ChannelXEvent feature.
8753  This feature may not be available on all devices. Please refer to the
8754  specific device data sheet to determine availability or include the
8755  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8756  whether this feature is available.
8757 */
8758 
8759 bool
8761  DMA_MODULE_ID index ,
8762  DMA_CHANNEL channel ) ;
8763 // *****************************************************************************
8764 // *****************************************************************************
8765 // Section: DMA Channel Configuration Functions
8766 // *****************************************************************************
8767 // *****************************************************************************
8768 //******************************************************************************
8769 /* Function:
8770  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8771  DMA_CHANNEL channel,
8772  DMA_CHANNEL_PRIORITY channelPriority )
8773  Summary:
8774  Sets the priority of the specified channel.
8775  Description:
8776  This function sets the priority of the specified channel.
8777  Precondition:
8778  None.
8779  Parameters:
8780  channel - One of the existing DMA channels listed by DMA_CHANNEL
8781  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8782  Returns:
8783  None.
8784  Example:
8785  <code>
8786  DMA_CHANNEL channel = DMA_CHANNEL_0;
8787  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8788  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8789  </code>
8790  Remarks:
8791  This function implements an operation of the ChannelXPriority feature.
8792  This feature may not be available on all devices. Please refer to the
8793  specific device data sheet to determine availability or use the
8794  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8795  whether this feature is available.
8796 */
8797 
8798 void
8800  DMA_MODULE_ID index ,
8801  DMA_CHANNEL channel ,
8802  DMA_CHANNEL_PRIORITY channelPriority ) ;
8803 //******************************************************************************
8804 /* Function:
8805  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8806  DMA_CHANNEL channel )
8807  Summary:
8808  Gets the priority of the specified channel.
8809  Description:
8810  This function gets the priority of the specified channel.
8811  Precondition:
8812  None.
8813  Parameters:
8814  channel - One of the existing DMA channels listed by DMA_CHANNEL
8815  Returns:
8816  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8817  Example:
8818  <code>
8819  DMA_CHANNEL channel = DMA_CHANNEL_0;
8820  DMA_CHANNEL_PRIORITY channelPriority;
8821  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8822  </code>
8823  Remarks:
8824  This function implements an operation of the ChannelXPriority feature.
8825  This feature may not be available on all devices. Please refer to the
8826  specific device data sheet to determine availability or use the
8827  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8828  whether this feature is available.
8829 */
8830 
8831 DMA_CHANNEL_PRIORITY
8833  DMA_MODULE_ID index ,
8834  DMA_CHANNEL channel ) ;
8835 //******************************************************************************
8836 /* Function:
8837  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8838  DMA_CHANNEL_PRIORITY channelPriority )
8839  Summary:
8840  Sets the priority scheme of the DMA channels.
8841  Description:
8842  This function sets the priority scheme of the DMA channels at the global level.
8843  This function is used in devices that do not have the per channel priority feature.
8844  Precondition:
8845  None.
8846  Parameters:
8847  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8848  Returns:
8849  None.
8850  Example:
8851  <code>
8852  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8853  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8854  </code>
8855  Remarks:
8856  This feature is not available on all devices. Please refer to the specific
8857  device data sheet to determine availability.
8858 */
8859 
8860 void
8862  DMA_MODULE_ID index ,
8863  DMA_CHANNEL_PRIORITY channelPriority ) ;
8864 //******************************************************************************
8865 /* Function:
8866  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8867  Summary:
8868  Gets the priority scheme of the DMA channels.
8869  Description:
8870  This function gets the priority scheme of the DMA channels at the global level.
8871  This function is used in devices that do not have the per channel priority feature.
8872  Precondition:
8873  None.
8874  Parameters:
8875  None.
8876  Returns:
8877  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8878  Example:
8879  <code>
8880  DMA_CHANNEL_PRIORITY channelPriority;
8881  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8882  </code>
8883  Remarks:
8884  This feature is not available on all devices. Please refer to the specific
8885  device data sheet to determine availability.
8886 */
8887 
8888 DMA_CHANNEL_PRIORITY
8890  DMA_MODULE_ID index ) ;
8891 //******************************************************************************
8892 /* Function:
8893  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8894  DMA_CHANNEL channel )
8895  Summary:
8896  Channel is continuously enabled.
8897  Description:
8898  This function enables the channel continuously. The channel is not automatically
8899  disabled after a block transfer is complete.
8900  Precondition:
8901  None.
8902  Parameters:
8903  channel - One of the possible DMA channels listed by DMA_CHANNEL
8904  Returns:
8905  None.
8906  Example:
8907  <code>
8908  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8909  </code>
8910  Remarks:
8911  This function implements an operation of the ChannelXAuto feature.
8912  This feature may not be available on all devices. Please refer to the
8913  specific device data sheet to determine availability or use the
8914  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8915  whether this feature is available.
8916 */
8917 
8918 void
8920  DMA_MODULE_ID index ,
8921  DMA_CHANNEL channel ) ;
8922 //******************************************************************************
8923 /* Function:
8924  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8925  DMA_CHANNEL channel )
8926  Summary:
8927  Returns the channel automatic enable status.
8928  Description:
8929  This function returns the channel automatic enable status.
8930  Precondition:
8931  None.
8932  Parameters:
8933  channel - One of the possible DMA channels listed by DMA_CHANNEL
8934  Returns:
8935  - true - Channel automatic enable is on
8936  - false - Channel automatic enable is off
8937  Example:
8938  <code>
8939  bool ChAutoEnableStatus;
8940  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8941  </code>
8942  Remarks:
8943  This function implements an operation of the ChannelXAuto feature.
8944  This feature may not be available on all devices. Please refer to the
8945  specific device data sheet to determine availability or use the
8946  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8947  whether this feature is available.
8948 */
8949 
8950 bool
8952  DMA_MODULE_ID index ,
8953  DMA_CHANNEL channel ) ;
8954 //******************************************************************************
8955 /* Function:
8956  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8957  DMA_CHANNEL channel )
8958  Summary:
8959  Channel is disabled after a block transfer is complete.
8960  Description:
8961  This function disables a channel after a block transfer is complete.
8962  Precondition:
8963  None.
8964  Parameters:
8965  channel - One of the possible DMA channels listed by DMA_CHANNEL
8966  Returns:
8967  None.
8968  Example:
8969  <code>
8970  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8971  </code>
8972  Remarks:
8973  This function implements an operation of the ChannelXAuto feature.
8974  This feature may not be available on all devices. Please refer to the
8975  specific device data sheet to determine availability or use the
8976  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8977  whether this feature is available.
8978 */
8979 
8980 void
8982  DMA_MODULE_ID index ,
8983  DMA_CHANNEL channel ) ;
8984 //******************************************************************************
8985 /* Function:
8986  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8987  DMA_CHANNEL channel )
8988  Summary:
8989  Channel chain feature is enabled.
8990  Description:
8991  This function enables the channel chain feature.
8992  Precondition:
8993  None.
8994  Parameters:
8995  channel - One of the possible DMA channels listed by DMA_CHANNEL
8996  Returns:
8997  None.
8998  Example:
8999  <code>
9000  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
9001  </code>
9002  Remarks:
9003  This function implements an operation of the ChannelXChainEnbl feature.
9004  This feature may not be available on all devices. Please refer to the
9005  specific device data sheet to determine availability or use the
9006  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
9007  whether this feature is available.
9008 */
9009 
9010 void
9012  DMA_MODULE_ID index ,
9013  DMA_CHANNEL channel ) ;
9014 //******************************************************************************
9015 /* Function:
9016  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
9017  DMA_CHANNEL channel )
9018  Summary:
9019  Returns the chain status of the specified channel.
9020  Description:
9021  This function returns the chain status of the specified channel.
9022  Precondition:
9023  None.
9024  Parameters:
9025  channel - One of the possible DMA channels listed by DMA_CHANNEL
9026  Returns:
9027  - true - The channel chain is on for this channel
9028  - false - The channel chain is off for this channel
9029  Example:
9030  <code>
9031  bool ChchainStatus;
9032  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
9033  </code>
9034  Remarks:
9035  This function implements an operation of the ChannelXChainEnbl feature.
9036  This feature may not be available on all devices. Please refer to the
9037  specific device data sheet to determine availability or use the
9038  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
9039  whether this feature is available.
9040 */
9041 
9042 bool
9044  DMA_MODULE_ID index ,
9045  DMA_CHANNEL channel ) ;
9046 //******************************************************************************
9047 /* Function:
9048  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
9049  DMA_CHANNEL channel )
9050  Summary:
9051  Disables the channel chaining for the specified DMA channel.
9052  Description:
9053  This function disables the channel chaining for the specified DMA channel.
9054  Precondition:
9055  None.
9056  Parameters:
9057  channel - One of the possible DMA channels listed by DMA_CHANNEL
9058  Returns:
9059  None.
9060  Example:
9061  <code>
9062  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
9063  </code>
9064  Remarks:
9065  This function implements an operation of the ChannelXChainEnbl feature.
9066  This feature may not be available on all devices. Please refer to the
9067  specific device data sheet to determine availability or use the
9068  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
9069  whether this feature is available.
9070 */
9071 
9072 void
9074  DMA_MODULE_ID index ,
9075  DMA_CHANNEL channel ) ;
9076 //******************************************************************************
9077 /* Function:
9078  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
9079  DMA_CHANNEL channel )
9080  Summary:
9081  Channel start/abort events will be registered even if the channel is
9082  disabled.
9083  Description:
9084  This function will allow the channel register start/abort events even if the
9085  channel is disabled.
9086  Precondition:
9087  None.
9088  Parameters:
9089  channel - One of the possible DMA channels listed by DMA_CHANNEL
9090  Returns:
9091  None.
9092  Example:
9093  <code>
9094  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
9095  </code>
9096  Remarks:
9097  This function implements an operation of the ChannelXDisabled feature.
9098  This feature may not be available on all devices. Please refer to the
9099  specific device data sheet to determine availability or use the
9100  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
9101  determine whether this feature is available.
9102 */
9103 
9104 void
9106  DMA_MODULE_ID index ,
9107  DMA_CHANNEL channel ) ;
9108 //******************************************************************************
9109 /* Function:
9110  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
9111  DMA_CHANNEL channel )
9112  Summary:
9113  Channel start/abort events will be ignored even if the channel is
9114  disabled.
9115  Description:
9116  This function will allow the channel start/abort events to be ignored even if
9117  the channel is disabled.
9118  Precondition:
9119  None.
9120  Parameters:
9121  channel - One of the possible DMA channels listed by DMA_CHANNEL
9122  Returns:
9123  None.
9124  Example:
9125  <code>
9126  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
9127  </code>
9128  Remarks:
9129  This function implements an operation of the ChannelXDisabled feature.
9130  This feature may not be available on all devices. Please refer to the
9131  specific device data sheet to determine availability or use the
9132  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
9133  determine whether this feature is available.
9134 */
9135 
9136 void
9138  DMA_MODULE_ID index ,
9139  DMA_CHANNEL channel ) ;
9140 //******************************************************************************
9141 /* Function:
9142  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
9143  DMA_CHANNEL channel )
9144  Summary:
9145  Enable the specified channel.
9146  Description:
9147  This function will enable the specified channel.
9148  Precondition:
9149  None.
9150  Parameters:
9151  channel - One of the possible DMA channels listed by DMA_CHANNEL
9152  Returns:
9153  None.
9154  Example:
9155  <code>
9156  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
9157  </code>
9158  Remarks:
9159  This function implements an operation of the ChannelX feature.
9160  This feature may not be available on all devices. Please refer to the
9161  specific device data sheet to determine availability or use the
9162  PLIB_DMA_ExistsChannelX function in your application to automatically
9163  determine whether this feature is available.
9164 */
9165 
9166 void
9168  DMA_MODULE_ID index ,
9169  DMA_CHANNEL channel ) ;
9170 //******************************************************************************
9171 /* Function:
9172  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
9173  DMA_CHANNEL channel )
9174  Summary:
9175  Return the enable status of the specified channel.
9176  Description:
9177  This function will return the enable status of the specified channel.
9178  Precondition:
9179  None.
9180  Parameters:
9181  channel - One of the possible DMA channels listed by DMA_CHANNEL
9182  Returns:
9183  - true - The specified DMA channel is enabled
9184  - false - The specified DMA channel is disabled
9185  Example:
9186  <code>
9187  bool chEnableStatus;
9188  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
9189  </code>
9190  Remarks:
9191  This function implements an operation of the ChannelX feature.
9192  This feature may not be available on all devices. Please refer to the
9193  specific device data sheet to determine availability or use the
9194  PLIB_DMA_ExistsChannelX function in your application to automatically
9195  determine whether this feature is available.
9196 */
9197 
9198 bool
9200  DMA_MODULE_ID index ,
9201  DMA_CHANNEL channel ) ;
9202 //******************************************************************************
9203 /* Function:
9204  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
9205  DMA_CHANNEL channel )
9206  Summary:
9207  Disable the specified channel.
9208  Description:
9209  This function will disable the specified channel.
9210  Precondition:
9211  None.
9212  Parameters:
9213  channel - One of the possible DMA channels listed by DMA_CHANNEL
9214  Returns:
9215  None.
9216  Example:
9217  <code>
9218  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
9219  </code>
9220  Remarks:
9221  This function implements an operation of the ChannelX feature.
9222  This feature may not be available on all devices. Please refer to the
9223  specific device data sheet to determine availability or use the
9224  PLIB_DMA_ExistsChannelX function in your application to automatically
9225  determine whether this feature is available.
9226 */
9227 
9228 void
9230  DMA_MODULE_ID index ,
9231  DMA_CHANNEL channel ) ;
9232 //******************************************************************************
9233 /* Function:
9234  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
9235  DMA_CHANNEL channel )
9236  Summary:
9237  Chains the specified channel to a channel lower in natural priority.
9238  Description:
9239  This function will chain the specified channel to a channel lower in
9240  natural priority. CH3 will be enabled by a CH4 transfer complete.
9241  Precondition:
9242  None.
9243  Parameters:
9244  channel - One of the possible DMA channels listed by DMA_CHANNEL
9245  Returns:
9246  None.
9247  Example:
9248  <code>
9249  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
9250  </code>
9251  Remarks:
9252  This function implements an operation of the ChannelXChain feature.
9253  This feature may not be available on all devices. Please refer to the
9254  specific device data sheet to determine availability or use the
9255  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9256  determine whether this feature is available.
9257 */
9258 
9259 void
9261  DMA_MODULE_ID index ,
9262  DMA_CHANNEL channel ) ;
9263 //******************************************************************************
9264 /* Function:
9265  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
9266  DMA_CHANNEL channel )
9267  Summary:
9268  Chains the specified channel to a channel higher in natural priority.
9269  Description:
9270  This function will chain the specified channel to a channel higher in
9271  natural priority. CH5 will be enabled by a CH4 transfer complete.
9272  Precondition:
9273  None.
9274  Parameters:
9275  channel - One of the possible DMA channels listed by DMA_CHANNEL
9276  Returns:
9277  None.
9278  Example:
9279  <code>
9280  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
9281  </code>
9282  Remarks:
9283  This function implements an operation of the ChannelXChain feature.
9284  This feature may not be available on all devices. Please refer to the
9285  specific device data sheet to determine availability or use the
9286  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9287  determine whether this feature is available.
9288 */
9289 
9290 void
9292  DMA_MODULE_ID index ,
9293  DMA_CHANNEL channel ) ;
9294 //******************************************************************************
9295 /* Function:
9296  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
9297  DMA_CHANNEL channel )
9298  Summary:
9299  Sets the Busy bit to active.
9300  Description:
9301  This function sets the Busy bit to active, indicating the channel is active
9302  or has been enabled.
9303  Precondition:
9304  None.
9305  Parameters:
9306  channel - One of the possible DMA channels listed by DMA_CHANNEL
9307  Returns:
9308  None.
9309  Example:
9310  <code>
9311  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9312  </code>
9313  Remarks:
9314  This function implements an operation of the ChannelXBusy feature.
9315  This feature may not be available on all devices. Please refer to the
9316  specific device data sheet to determine availability or use the
9317  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9318  determine whether this feature is available.
9319 */
9320 
9321 void
9323  DMA_MODULE_ID index ,
9324  DMA_CHANNEL channel ) ;
9325 //******************************************************************************
9326 /* Function:
9327  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
9328  DMA_CHANNEL channel )
9329  Summary:
9330  Sets the Busy bit to inactive.
9331  Description:
9332  This function sets the Busy bit to inactive, indicating the channel is inactive
9333  or has been disabled.
9334  Precondition:
9335  None.
9336  Parameters:
9337  channel - One of the possible DMA channels listed by DMA_CHANNEL
9338  Returns:
9339  None.
9340  Example:
9341  <code>
9342  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9343  </code>
9344  Remarks:
9345  This function implements an operation of the ChannelXBusy feature.
9346  This feature may not be available on all devices. Please refer to the
9347  specific device data sheet to determine availability or use the
9348  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9349  determine whether this feature is available.
9350 */
9351 
9352 void
9354  DMA_MODULE_ID index ,
9355  DMA_CHANNEL channel ) ;
9356 //******************************************************************************
9357 /* Function:
9358  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
9359  DMA_CHANNEL channel )
9360  Summary:
9361  Returns the busy status of the specified channel.
9362  Description:
9363  This function returns the busy status of the specified channel.
9364  Precondition:
9365  None.
9366  Parameters:
9367  channel - One of the possible DMA channels listed by DMA_CHANNEL
9368  Returns:
9369  - true - The channel is active or has been enabled
9370  - false - The channel is inactive or has been disabled
9371  Example:
9372  <code>
9373  bool chBusyStatus;
9374  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
9375  </code>
9376  Remarks:
9377  This function implements an operation of the ChannelXBusy feature.
9378  This feature may not be available on all devices. Please refer to the
9379  specific device data sheet to determine availability or use the
9380  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9381  determine whether this feature is available.
9382 */
9383 
9384 bool
9386  DMA_MODULE_ID index ,
9387  DMA_CHANNEL channel ) ;
9388 //******************************************************************************
9389 /* Function:
9390  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
9391  DMA_CHANNEL channel,
9392  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
9393  Summary:
9394  Selects the data transfer direction of the specified channel.
9395  Description:
9396  This function selects the data transfer direction of the specified channel.
9397  Precondition:
9398  None.
9399  Parameters:
9400  channel - One of the possible DMA channels listed by DMA_CHANNEL
9401  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
9402  Returns:
9403  None.
9404  Example:
9405  <code>
9406  PLIB_DMA_ChannelXTransferDirectionSelect (
9407  DMA_ID_0,
9408  DMA_CHANNEL_4,
9409  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
9410  </code>
9411  Remarks:
9412  This feature is not available on all devices. Please refer to the specific
9413  device data sheet to determine availability.
9414 */
9415 
9416 void
9418  DMA_MODULE_ID index ,
9419  DMA_CHANNEL channel ,
9420  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
9421 //******************************************************************************
9422 /* Function:
9423  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
9424  DMA_MODULE_ID index,
9425  DMA_CHANNEL channel)
9426  Summary:
9427  Returns the data transfer direction of the specified channel.
9428  Description:
9429  This function returns the data transfer direction of the specified channel.
9430  Precondition:
9431  None.
9432  Parameters:
9433  channel - One of the possible DMA channels listed by DMA_CHANNEL
9434  Returns:
9435  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
9436  DMA_CHANNEL_TRANSFER_DIRECTION
9437  Example:
9438  <code>
9439  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
9440  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
9441  DMA_ID_0,
9442  DMA_CHANNEL_4 );
9443  </code>
9444  Remarks:
9445  This feature is not available on all devices. Please refer to the specific
9446  device data sheet to determine availability.
9447 */
9448 
9449 DMA_CHANNEL_TRANSFER_DIRECTION
9451  DMA_MODULE_ID index ,
9452  DMA_CHANNEL channel ) ;
9453 //******************************************************************************
9454 /* Function:
9455  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
9456  DMA_CHANNEL channel ,
9457  uint16_t address,
9458  DMA_ADDRESS_OFFSET_TYPE offset )
9459  Summary:
9460  Sets the primary/secondary start address (DPSRAM) offset to the value
9461  specified depending on the offset type specified for the specified channel.
9462  Description:
9463  This function sets the primary/secondary start address (DPSRAM) offset to the value
9464  specified depending on the offset type specified for the specified channel.
9465  Precondition:
9466  None.
9467  Parameters:
9468  channel - One of the possible DMA channels listed by DMA_CHANNEL
9469  address - The primary/secondary DPSRAM start address offset
9470  offset - The type of the address offset (primary/secondary)
9471  Returns:
9472  None.
9473  Example:
9474  <code>
9475  uint16_t address = 0x100;
9476  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
9477  DMA_CHANNEL_4,
9478  address,
9479  DMA_ADDRESS_OFFSET_PRIMARY );
9480  </code>
9481  Remarks:
9482  This feature is not available on all devices. Please refer to the specific
9483  device data sheet to determine availability.
9484 */
9485 
9486 void
9488  DMA_MODULE_ID index ,
9489  DMA_CHANNEL channel ,
9490  uint16_t address ,
9491  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9492 //******************************************************************************
9493 /* Function:
9494  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
9495  DMA_CHANNEL channel,
9496  DMA_ADDRESS_OFFSET_TYPE offset)
9497  Summary:
9498  Gets the primary/secondary start address (DPSRAM) offset.
9499  Description:
9500  This function gets the primary/secondary start address (DPSRAM) offset.
9501  Precondition:
9502  None.
9503  Parameters:
9504  channel - One of the possible DMA channels listed by DMA_CHANNEL
9505  offset - The type of the address offset (primary/secondary)
9506  Returns:
9507  - uint16_t - The primary/secondary DPSRAM start address offset
9508  Example:
9509  <code>
9510  uint16_t addressOffsetA;
9511  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
9512  DMA_ID_0,
9513  DMA_CHANNEL_4,
9514  address,
9515  DMA_ADDRESS_OFFSET_PRIMARY );
9516  </code>
9517  Remarks:
9518  This feature is not available on all devices. Please refer to the specific
9519  device data sheet to determine availability.
9520 */
9521 
9522 uint16_t
9524  DMA_MODULE_ID index ,
9525  DMA_CHANNEL channel ,
9526  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9527 //******************************************************************************
9528 /* Function:
9529  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
9530  DMA_CHANNEL channel ,
9531  uint16_t peripheraladdress )
9532  Summary:
9533  Sets the peripheral address for the specified channel.
9534  Description:
9535  This function sets the peripheral address for the specified channel.
9536  Precondition:
9537  None.
9538  Parameters:
9539  channel - One of the possible DMA channels listed by DMA_CHANNEL
9540  peripheraladdress - The peripheral address for the specified channel
9541  Returns:
9542  None.
9543  Example:
9544  <code>
9545  uint16_t peripheraladdress = 0x100;
9546  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
9547  DMA_CHANNEL_4,
9548  peripheraladdress );
9549  </code>
9550  Remarks:
9551  This feature is not available on all devices. Please refer to the specific
9552  device data sheet to determine availability.
9553 */
9554 
9555 void
9557  DMA_MODULE_ID index ,
9558  DMA_CHANNEL channel ,
9559  uint16_t peripheraladdress ) ;
9560 //******************************************************************************
9561 /* Function:
9562  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9563  DMA_CHANNEL channel )
9564  Summary:
9565  Gets the peripheral address configured for the specified channel.
9566  Description:
9567  This function gets the peripheral address configured for the specified channel.
9568  Precondition:
9569  None.
9570  Parameters:
9571  channel - One of the possible DMA channels listed by DMA_CHANNEL
9572  Returns:
9573  - uint16_t - The peripheral address configured for the specified channel
9574  Example:
9575  <code>
9576  uint16_t peripheraladdress;
9577  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9578  DMA_CHANNEL_4 );
9579  </code>
9580  Remarks:
9581  This feature is not available on all devices. Please refer to the specific
9582  device data sheet to determine availability.
9583 */
9584 
9585 uint16_t
9587  DMA_MODULE_ID index ,
9588  DMA_CHANNEL channel ) ;
9589 //******************************************************************************
9590 /* Function:
9591  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9592  DMA_CHANNEL channel ,
9593  uint16_t transferCount )
9594  Summary:
9595  Sets the DMA data transfer count for the specified channel.
9596  Description:
9597  This function sets the DMA data transfer count for the specified channel.
9598  Precondition:
9599  None.
9600  Parameters:
9601  channel - One of the possible DMA channels listed by DMA_CHANNEL
9602  transferCount - The DMA transfer count for the channel
9603  Returns:
9604  None.
9605  Example:
9606  <code>
9607  uint16_t transferCount = 0x10;
9608  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9609  DMA_CHANNEL_4,
9610  transferCount );
9611  </code>
9612  Remarks:
9613  This feature is not available on all devices. Please refer to the specific
9614  device data sheet to determine availability.
9615 */
9616 
9617 void
9619  DMA_MODULE_ID index ,
9620  DMA_CHANNEL channel ,
9621  uint16_t transferCount ) ;
9622 //******************************************************************************
9623 /* Function:
9624  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9625  DMA_CHANNEL channel )
9626  Summary:
9627  Gets the DMA data transfer count that is programmed for the specified channel.
9628  Description:
9629  This function gets the DMA data transfer count that is programmed for the specified channel.
9630  Precondition:
9631  None.
9632  Parameters:
9633  channel - One of the possible DMA channels listed by DMA_CHANNEL
9634  Returns:
9635  - uint16_t - The DMA transfer count for the channel
9636  Example:
9637  <code>
9638  uint16_t transferCount;
9639  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9640  DMA_CHANNEL_4 );
9641  </code>
9642  Remarks:
9643  This feature is not available on all devices. Please refer to the specific
9644  device data sheet to determine availability.
9645 */
9646 
9647 uint16_t
9649  DMA_MODULE_ID index ,
9650  DMA_CHANNEL channel ) ;
9651 //******************************************************************************
9652 /* Function:
9653  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9654  DMA_MODULE_ID index,
9655  DMA_CHANNEL channel,
9656  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9657  Summary:
9658  Sets the source address mode of the specified channel.
9659  Description:
9660  This function sets the source address mode of the specified channel.
9661  Precondition:
9662  None.
9663  Parameters:
9664  channel - One of the possible DMA channels listed by DMA_CHANNEL
9665  sourceAddressMode - One of the possible source addressing modes listed by
9666  DMA_SOURCE_ADDRESSING_MODE
9667  Returns:
9668  None.
9669  Example:
9670  <code>
9671  PLIB_DMA_ChannelXSourceAddressModeSelect (
9672  DMA_ID_0,
9673  DMA_CHANNEL_4,
9674  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9675  </code>
9676  Remarks:
9677  This feature is not available on all devices. Please refer to the specific
9678  device data sheet to determine availability.
9679 */
9680 
9681 void
9683  DMA_MODULE_ID index ,
9684  DMA_CHANNEL channel ,
9685  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9686 //******************************************************************************
9687 /* Function:
9688  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9689  DMA_MODULE_ID index,
9690  DMA_CHANNEL channel )
9691  Summary:
9692  Gets the source address mode of the specified channel.
9693  Description:
9694  This function gets the source address mode of the specified channel.
9695  Precondition:
9696  None.
9697  Parameters:
9698  channel - One of the possible DMA channels listed by DMA_CHANNEL
9699  Returns:
9700  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9701  listed by DMA_SOURCE_ADDRESSING_MODE
9702  Example:
9703  <code>
9704  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9705  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9706  DMA_CHANNEL_4 );
9707  </code>
9708  Remarks:
9709  This feature is not available on all devices. Please refer to the specific
9710  device data sheet to determine availability.
9711 */
9712 
9713 DMA_SOURCE_ADDRESSING_MODE
9715  DMA_MODULE_ID index ,
9716  DMA_CHANNEL channel ) ;
9717 //******************************************************************************
9718 /* Function:
9719  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9720  DMA_MODULE_ID index,
9721  DMA_CHANNEL channel,
9722  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9723  Summary:
9724  Sets the source address mode of the specified channel.
9725  Description:
9726  This function Sets the source address mode of the specified channel.
9727  Precondition:
9728  None.
9729  Parameters:
9730  channel - One of the possible DMA channels listed by DMA_CHANNEL
9731  destinationAddressMode - One of the possible source addressing modes listed by
9732  DMA_DESTINATION_ADDRESSING_MODE
9733  Returns:
9734  None.
9735  Example:
9736  <code>
9737  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9738  DMA_ID_0,
9739  DMA_CHANNEL_4,
9740  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9741  </code>
9742  Remarks:
9743  This feature is not available on all devices. Please refer to the specific
9744  device data sheet to determine availability.
9745 */
9746 
9747 void
9749  DMA_MODULE_ID index ,
9750  DMA_CHANNEL channel ,
9751  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9752 //******************************************************************************
9753 /* Function:
9754  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9755  DMA_MODULE_ID index,
9756  DMA_CHANNEL channel )
9757  Summary:
9758  Gets the source address mode of the specified channel.
9759  Description:
9760  This function gets the source address mode of the specified channel.
9761  Precondition:
9762  None.
9763  Parameters:
9764  channel - One of the possible DMA channels listed by DMA_CHANNEL
9765  Returns:
9766  - destinationAddressMode - One of the possible source addressing modes listed by
9767  DMA_DESTINATION_ADDRESSING_MODE
9768  Example:
9769  <code>
9770  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9771  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9772  DMA_ID_0,
9773  DMA_CHANNEL_4 );
9774  </code>
9775  Remarks:
9776  This feature is not available on all devices. Please refer to the specific
9777  device data sheet to determine availability.
9778 */
9779 
9780 DMA_DESTINATION_ADDRESSING_MODE
9782  DMA_MODULE_ID index ,
9783  DMA_CHANNEL channel ) ;
9784 //******************************************************************************
9785 /* Function:
9786  void PLIB_DMA_ChannelXAddressModeSelect (
9787  DMA_MODULE_ID index,
9788  DMA_CHANNEL channel,
9789  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9790  Summary:
9791  Sets the channel address mode.
9792  Description:
9793  This function sets the channel address mode.
9794  Precondition:
9795  None.
9796  Parameters:
9797  channel - One of the possible DMA channels listed by DMA_CHANNEL
9798  channelAddressMode - One of the possible channel addressing modes listed by
9799  DMA_CHANNEL_ADDRESSING_MODE
9800  Returns:
9801  None.
9802  Example:
9803  <code>
9804  PLIB_DMA_ChannelXAddressModeSelect (
9805  DMA_ID_0,
9806  DMA_CHANNEL_4,
9807  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9808  </code>
9809  Remarks:
9810  This feature is not available on all devices. Please refer to the specific
9811  device data sheet to determine availability.
9812 */
9813 
9814 void
9816  DMA_MODULE_ID index ,
9817  DMA_CHANNEL channel ,
9818  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9819 //******************************************************************************
9820 /* Function:
9821  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9822  DMA_MODULE_ID index,
9823  DMA_CHANNEL channel )
9824  Summary:
9825  Gets the channel address mode.
9826  Description:
9827  This function gets the channel address mode.
9828  Precondition:
9829  None.
9830  Parameters:
9831  channel - One of the possible DMA channels listed by DMA_CHANNEL
9832  Returns:
9833  - channelAddressMode - One of the possible source addressing modes listed by
9834  DMA_CHANNEL_ADDRESSING_MODE
9835  Example:
9836  <code>
9837  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9838  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9839  DMA_CHANNEL_4 );
9840  </code>
9841  Remarks:
9842  This feature is not available on all devices. Please refer to the specific
9843  device data sheet to determine availability.
9844 */
9845 
9846 DMA_CHANNEL_ADDRESSING_MODE
9848  DMA_MODULE_ID index ,
9849  DMA_CHANNEL channel ) ;
9850 // *****************************************************************************
9851 // *****************************************************************************
9852 // Section: DMA Channel Event Configuration functions
9853 // *****************************************************************************
9854 // *****************************************************************************
9855 //******************************************************************************
9856 /* Function:
9857  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9858  DMA_CHANNEL channel,
9859  DMA_CHANNEL_TRIGGER_TYPE trigger )
9860  Summary:
9861  Enables the specified DMA channel trigger.
9862  Description:
9863  This function enables the specified DMA channel trigger.
9864  Precondition:
9865  None.
9866  Parameters:
9867  channel - One of the possible DMA channels listed by DMA_CHANNEL
9868  trigger - Type of trigger (transfer start/abort/pattern match abort)
9869  Returns:
9870  None.
9871  Example:
9872  <code>
9873  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9874  DMA_CHANNEL_4,
9875  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9876  </code>
9877  Remarks:
9878  This function implements an operation of the ChannelXTrigger feature.
9879  This feature may not be available on all devices. Please refer to the
9880  specific device data sheet to determine availability or use the
9881  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9882  determine whether this feature is available.
9883 */
9884 
9885 void
9887  DMA_MODULE_ID index ,
9888  DMA_CHANNEL channel ,
9889  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9890 //******************************************************************************
9891 /* Function:
9892  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9893  DMA_CHANNEL channel,
9894  DMA_CHANNEL_TRIGGER_TYPE trigger )
9895  Summary:
9896  Returns the enable status of the specified DMA transfer/abort trigger.
9897  Description:
9898  This function returns the enable status of the specified DMA transfer/abort trigger.
9899  Precondition:
9900  None.
9901  Parameters:
9902  channel - One of the possible DMA channels listed by DMA_CHANNEL
9903  trigger - Type of trigger (transfer start/abort/pattern match abort)
9904  Returns:
9905  - true - The specified trigger is enabled
9906  - false - The specified trigger is disabled
9907  Example:
9908  <code>
9909  bool startTriggerstatus;
9910  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9911  DMA_ID_0,
9912  DMA_CHANNEL_4,
9913  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9914  </code>
9915  Remarks:
9916  This function implements an operation of the ChannelXTrigger feature.
9917  This feature may not be available on all devices. Please refer to the
9918  specific device data sheet to determine availability or use the
9919  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9920  determine whether this feature is available.
9921 */
9922 
9923 bool
9925  DMA_MODULE_ID index ,
9926  DMA_CHANNEL channel ,
9927  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9928 //******************************************************************************
9929 /* Function:
9930  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9931  DMA_CHANNEL channel,
9932  DMA_CHANNEL_TRIGGER_TYPE trigger )
9933  Summary:
9934  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9935  Description:
9936  This function disables the DMA transfer abort via a matching interrupt
9937  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9938  a transfer.
9939  Precondition:
9940  None.
9941  Parameters:
9942  channel - One of the possible DMA channels listed by DMA_CHANNEL
9943  trigger - Type of trigger (transfer start/abort/pattern match abort)
9944  Returns:
9945  None.
9946  Example:
9947  <code>
9948  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9949  DMA_CHANNEL_4,
9950  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9951  </code>
9952  Remarks:
9953  This function implements an operation of the ChannelXTrigger feature.
9954  This feature may not be available on all devices. Please refer to the
9955  specific device data sheet to determine availability or use the
9956  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9957  determine whether this feature is available.
9958 */
9959 
9960 void
9962  DMA_MODULE_ID index ,
9963  DMA_CHANNEL channel ,
9964  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9965 //******************************************************************************
9966 /* Function:
9967  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9968  DMA_CHANNEL channel)
9969  Summary:
9970  Gets the source number for the DMA channel interrupts.
9971  Description:
9972  This function returns the interrupt source number for the specified
9973  DMA channel.
9974  Precondition:
9975  None.
9976  Parameters:
9977  channel - One of the possible DMA channels listed by DMA_CHANNEL
9978  Returns:
9979  None.
9980  Example:
9981  <code>
9982  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9983  DMA_CHANNEL_4);
9984  </code>
9985  Remarks:
9986  This function implements an operation of the ChannelXTrigger feature.
9987  This feature may not be available on all devices. Please refer to the
9988  specific device data sheet to determine availability or use the
9989  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9990  determine whether this feature is available.
9991 */
9992 
9993 DMA_CHANNEL_INT_SOURCE
9995  DMA_MODULE_ID index ,
9996  DMA_CHANNEL channel ) ;
9997 //******************************************************************************
9998 /* Function:
9999  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
10000  DMA_CHANNEL channel,
10001  DMA_TRIGGER_SOURCE IRQnum )
10002  Summary:
10003  Sets the IRQ to initiate the DMA transfer on the specified channel.
10004  Description:
10005  This function sets the IRQ to initiate the DMA transfer on the specified channel.
10006  (IRQ to start the channel transfer.)
10007  Precondition:
10008  None.
10009  Parameters:
10010  channel - One of the possible DMA channels listed by DMA_CHANNEL
10011  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
10012  Returns:
10013  None.
10014  Example:
10015  <code>
10016  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
10017  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
10018  DMA_CHANNEL_4,
10019  irq );
10020  </code>
10021  Remarks:
10022  This function implements an operation of the ChannelXStartIRQ feature.
10023  This feature may not be available on all devices. Please refer to the
10024  specific device data sheet to determine availability or use the
10025  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
10026  determine whether this feature is available.
10027 */
10028 
10029 void
10031  DMA_MODULE_ID index ,
10032  DMA_CHANNEL channel ,
10033  DMA_TRIGGER_SOURCE IRQnum ) ;
10034 //******************************************************************************
10035 /* Function:
10036  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
10037  DMA_CHANNEL channel,
10038  DMA_TRIGGER_SOURCE IRQ )
10039  Summary:
10040  Sets the IRQ to abort the DMA transfer on the specified channel.
10041  Description:
10042  This function sets the IRQ to abort the DMA transfer on the specified channel.
10043  (IRQ to start the channel transfer.)
10044  Precondition:
10045  None.
10046  Parameters:
10047  channel - One of the possible DMA channels listed by DMA_CHANNEL
10048  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
10049  Returns:
10050  None.
10051  Example:
10052  <code>
10053  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
10054  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
10055  DMA_CHANNEL_4,
10056  irq );
10057  </code>
10058  Remarks:
10059  This function implements an operation of the ChannelXAbortIRQ feature.
10060  This feature may not be available on all devices. Please refer to the
10061  specific device data sheet to determine availability or use the
10062  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
10063  determine whether this feature is available.
10064 */
10065 
10066 void
10068  DMA_MODULE_ID index ,
10069  DMA_CHANNEL channel ,
10070  DMA_TRIGGER_SOURCE IRQ ) ;
10071 //******************************************************************************
10072 /* Function:
10073  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
10074  DMA_CHANNEL channel,
10075  DMA_CHANNEL_DATA_SIZE channelDataSize )
10076  Summary:
10077  Selects the data size for the specified channel.
10078  Description:
10079  This function selects the data size for the specified channel.
10080  Precondition:
10081  None.
10082  Parameters:
10083  channel - One of the possible DMA channels listed by DMA_CHANNEL
10084  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
10085  Returns:
10086  None.
10087  Example:
10088  <code>
10089  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
10090  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
10091  DMA_CHANNEL_4,
10092  channelDataSize );
10093  </code>
10094  Remarks:
10095  This feature is not available on all devices. Please refer to the specific
10096  device data sheet to determine availability.
10097 */
10098 
10099 void
10101  DMA_MODULE_ID index ,
10102  DMA_CHANNEL channel ,
10103  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
10104 //******************************************************************************
10105 /* Function:
10106  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
10107  DMA_CHANNEL channel )
10108  Summary:
10109  Returns the current data size for the specified channel.
10110  Description:
10111  This function returns the current data size for the specified channel.
10112  Precondition:
10113  None.
10114  Parameters:
10115  channel - One of the possible DMA channels listed by DMA_CHANNEL
10116  Returns:
10117  - channelDataSize - One of the possible data sizes listed by
10118  DMA_CHANNEL_DATA_SIZE
10119  Example:
10120  <code>
10121  DMA_CHANNEL_DATA_SIZE channelDataSize;
10122  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
10123  DMA_CHANNEL_4 );
10124  </code>
10125  Remarks:
10126  This feature is not available on all devices. Please refer to the specific
10127  device data sheet to determine availability.
10128 */
10129 
10130 DMA_CHANNEL_DATA_SIZE
10132  DMA_MODULE_ID index ,
10133  DMA_CHANNEL channel ) ;
10134 //******************************************************************************
10135 /* Function:
10136  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
10137  DMA_MODULE_ID index,
10138  DMA_CHANNEL channel,
10139  DMA_TRANSFER_MODE channeltransferMode )
10140  Summary:
10141  Selects the transfer/operating mode for the specified channel.
10142  Description:
10143  This function selects the transfer/operating mode for the specified channel.
10144  (Transfer mode and operating mode are used interchangeably.)
10145  Precondition:
10146  None.
10147  Parameters:
10148  channel - One of the possible DMA channels listed by DMA_CHANNEL
10149  channeltransferMode - One of the possible operating/transfer modes listed by
10150  DMA_TRANSFER_MODE
10151  Returns:
10152  None.
10153  Example:
10154  <code>
10155  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
10156  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
10157  DMA_CHANNEL_4,
10158  channeltransferMode );
10159  </code>
10160  Remarks:
10161  This feature is not available on all devices. Please refer to the specific
10162  device data sheet to determine availability.
10163 */
10164 
10165 void
10167  DMA_MODULE_ID index ,
10168  DMA_CHANNEL channel ,
10169  DMA_TRANSFER_MODE channeltransferMode ) ;
10170 //******************************************************************************
10171 /* Function:
10172  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
10173  DMA_MODULE_ID index,
10174  DMA_CHANNEL channel )
10175  Summary:
10176  Returns the current transfer/operating mode for the specified channel.
10177  Description:
10178  This function returns the current transfer/operating mode for the specified channel.
10179  (Transfer mode and operating mode are used interchangeably.)
10180  Precondition:
10181  None.
10182  Parameters:
10183  channel - One of the possible DMA channels listed by DMA_CHANNEL
10184  Returns:
10185  - channeltransferMode - One of the possible operating/transfer modes listed
10186  by DMA_TRANSFER_MODE
10187  Example:
10188  <code>
10189  DMA_TRANSFER_MODE channeltransferMode;
10190  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
10191  DMA_ID_0,
10192  DMA_CHANNEL_4 );
10193  </code>
10194  Remarks:
10195  This feature is not available on all devices. Please refer to the specific
10196  device data sheet to determine availability.
10197 */
10198 
10199 DMA_TRANSFER_MODE
10201  DMA_MODULE_ID index ,
10202  DMA_CHANNEL channel ) ;
10203 //******************************************************************************
10204 /* Function:
10205  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
10206  DMA_CHANNEL channel )
10207  Summary:
10208  Enables reloading of the address and count registers.
10209  Description:
10210  This function enables reloading of the address and count registers. The source,
10211  destination address, and the DMA count registers are reloaded to their previous
10212  values upon the start of the next operation.
10213  Precondition:
10214  None.
10215  Parameters:
10216  channel - One of the possible DMA channels listed by DMA_CHANNEL
10217  Returns:
10218  None.
10219  Example:
10220  <code>
10221  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
10222  DMA_CHANNEL_4 );
10223  </code>
10224  Remarks:
10225  This feature is not available on all devices. Please refer to the specific
10226  device data sheet to determine availability.
10227 */
10228 
10229 void
10231  DMA_MODULE_ID index ,
10232  DMA_CHANNEL channel ) ;
10233 //******************************************************************************
10234 /* Function:
10235  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
10236  DMA_CHANNEL channel )
10237  Summary:
10238  Returns the address and count registers reload enable status.
10239  Description:
10240  This function returns the address and count registers reload enable status.
10241  Precondition:
10242  None.
10243  Parameters:
10244  channel - One of the possible DMA channels listed by DMA_CHANNEL
10245  Returns:
10246  - true - The address and count registers reload is enabled
10247  - false - The address and count registers reload is disabled
10248  Example:
10249  <code>
10250  bool chAddressCountReloadStatus;
10251  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
10252  DMA_ID_0,
10253  DMA_CHANNEL_4 );
10254  </code>
10255  Remarks:
10256  This feature is not available on all devices. Please refer to the specific
10257  device data sheet to determine availability.
10258 */
10259 
10260 bool
10262  DMA_MODULE_ID index ,
10263  DMA_CHANNEL channel ) ;
10264 //******************************************************************************
10265 /* Function:
10266  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
10267  DMA_CHANNEL channel )
10268  Summary:
10269  Disables reloading of the address and count registers.
10270  Description:
10271  This function disables reloading of the address and count registers. The source, destination
10272  address, and the DMA count registers are not reloaded to their previous values upon
10273  the start of the next operation.
10274  Precondition:
10275  None.
10276  Parameters:
10277  channel - One of the possible DMA channels listed by DMA_CHANNEL
10278  Returns:
10279  None.
10280  Example:
10281  <code>
10282  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
10283  DMA_CHANNEL_4 );
10284  </code>
10285  Remarks:
10286  This feature is not available on all devices. Please refer to the specific
10287  device data sheet to determine availability.
10288 */
10289 
10290 void
10292  DMA_MODULE_ID index ,
10293  DMA_CHANNEL channel ) ;
10294 //******************************************************************************
10295 /* Function:
10296  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
10297  DMA_CHANNEL channel )
10298  Summary:
10299  Enables the Null Write mode.
10300  Description:
10301  This function enables the Null Write mode. A dummy write is initiated to the
10302  source address for every write to the destination address.
10303  Precondition:
10304  None.
10305  Parameters:
10306  channel - One of the possible DMA channels listed by DMA_CHANNEL
10307  Returns:
10308  None.
10309  Example:
10310  <code>
10311  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
10312  DMA_CHANNEL_4 );
10313  </code>
10314  Remarks:
10315  This feature is not available on all devices. Please refer to the specific
10316  device data sheet to determine availability.
10317 */
10318 
10319 void
10321  DMA_MODULE_ID index ,
10322  DMA_CHANNEL channel ) ;
10323 //******************************************************************************
10324 /* Function:
10325  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
10326  DMA_CHANNEL channel )
10327  Summary:
10328  Returns the enable status of the Null Write mode for the specified channel.
10329  Description:
10330  This function returns the enable status of the Null Write mode for the specified channel.
10331  Precondition:
10332  None.
10333  Parameters:
10334  channel - One of the possible DMA channels listed by DMA_CHANNEL
10335  Returns:
10336  - true - Null write mode is enabled for this channel
10337  - false - Null write mode is disabled for this channel
10338  Example:
10339  <code>
10340  bool chNullWriteStatus;
10341  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
10342  DMA_ID_0,
10343  DMA_CHANNEL_4 );
10344  </code>
10345  Remarks:
10346  This feature is not available on all devices. Please refer to the specific
10347  device data sheet to determine availability.
10348 */
10349 
10350 bool
10352  DMA_MODULE_ID index ,
10353  DMA_CHANNEL channel ) ;
10354 //******************************************************************************
10355 /* Function:
10356  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
10357  DMA_CHANNEL channel )
10358  Summary:
10359  Disables the Null Write mode.
10360  Description:
10361  This function disables the Null Write mode. No dummy write is initiated.
10362  Precondition:
10363  None.
10364  Parameters:
10365  channel - One of the possible DMA channels listed by DMA_CHANNEL
10366  Returns:
10367  None.
10368  Example:
10369  <code>
10370  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
10371  DMA_CHANNEL_4 );
10372  </code>
10373  Remarks:
10374  This feature is not available on all devices. Please refer to the specific
10375  device data sheet to determine availability.
10376 */
10377 
10378 void
10380  DMA_MODULE_ID index ,
10381  DMA_CHANNEL channel ) ;
10382 // *****************************************************************************
10383 // *****************************************************************************
10384 // Section: DMA start/end functions
10385 // *****************************************************************************
10386 // *****************************************************************************
10387 //******************************************************************************
10388 /* Function:
10389  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
10390  DMA_CHANNEL channel )
10391  Summary:
10392  Initiates transfer on the specified channel.
10393  Description:
10394  This function initiates transfer on the specified channel. This is a forced transfer
10395  controlled via software.
10396  Precondition:
10397  None.
10398  Parameters:
10399  channel - One of the possible DMA channels listed by DMA_CHANNEL
10400  Returns:
10401  None.
10402  Example:
10403  <code>
10404  PLIB_DMA_StartTransferSet ( DMA_ID_0,
10405  DMA_CHANNEL_4 );
10406  </code>
10407  Remarks:
10408  This function implements an operation of the StartTransfer feature.
10409  This feature may not be available on all devices. Please refer to the
10410  specific device data sheet to determine availability or use the
10411  PLIB_DMA_ExistsStartTransfer function in your application to automatically
10412  determine whether this feature is available.
10413 */
10414 
10415 void
10417  DMA_MODULE_ID index ,
10418  DMA_CHANNEL channel ) ;
10419 //******************************************************************************
10420 /* Function:
10421  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
10422  DMA_CHANNEL channel )
10423  Summary:
10424  Aborts transfer on the specified channel.
10425  Description:
10426  This function aborts transfer on the specified channel. This is a forced abort
10427  controlled via software.
10428  Precondition:
10429  None.
10430  Parameters:
10431  channel - One of the possible DMA channels listed by DMA_CHANNEL
10432  Returns:
10433  None.
10434  Example:
10435  <code>
10436  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
10437  DMA_CHANNEL_4 );
10438  </code>
10439  Remarks:
10440  This function implements an operation of the AbortTransfer feature.
10441  This feature may not be available on all devices. Please refer to the
10442  specific device data sheet to determine availability or use the
10443  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
10444  determine whether this feature is available.
10445 */
10446 
10447 void
10449  DMA_MODULE_ID index ,
10450  DMA_CHANNEL channel ) ;
10451 // *****************************************************************************
10452 // *****************************************************************************
10453 // Section: DMA General Configuration functions
10454 // *****************************************************************************
10455 // *****************************************************************************
10456 //******************************************************************************
10457 /* Function:
10458  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
10459  Summary:
10460  Sets the BUSY bit of the DMA controller.
10461  Description:
10462  This function sets the BUSY bit of the DMA controller. The DMA module is active.
10463  Precondition:
10464  None.
10465  Parameters:
10466  None.
10467  Returns:
10468  None.
10469  Example:
10470  <code>
10471  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
10472  </code>
10473  Remarks:
10474  This function implements an operation of the Busy feature.
10475  This feature may not be available on all devices. Please refer to the
10476  specific device data sheet to determine availability or use the
10477  PLIB_DMA_ExistsBusy function in your application to automatically
10478  determine whether this feature is available.
10479 */
10480 
10481 void
10483  DMA_MODULE_ID index ) ;
10484 //******************************************************************************
10485 /* Function:
10486  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
10487  Summary:
10488  Resets the BUSY bit of the DMA controller.
10489  Description:
10490  This function resets the BUSY bit of the DMA controller. The DMA module is
10491  disabled and is not actively transferring data.
10492  Precondition:
10493  None.
10494  Parameters:
10495  None.
10496  Returns:
10497  None.
10498  Example:
10499  <code>
10500  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
10501  </code>
10502  Remarks:
10503  This function implements an operation of the Busy feature.
10504  This feature may not be available on all devices. Please refer to the
10505  specific device data sheet to determine availability or use the
10506  PLIB_DMA_ExistsBusy function in your application to automatically
10507  determine whether this feature is available.
10508 */
10509 
10510 void
10512  DMA_MODULE_ID index ) ;
10513 //******************************************************************************
10514 /* Function:
10515  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
10516  Summary:
10517  Gets the BUSY bit of the DMA controller.
10518  Description:
10519  This function gets the BUSY bit of the DMA controller.
10520  Precondition:
10521  None.
10522  Parameters:
10523  None.
10524  Returns:
10525  - true - DMA module is active
10526  - false - DMA module is disabled and is not actively transferring data
10527  Example:
10528  <code>
10529  bool dmaBusyStatus;
10530  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
10531  </code>
10532  Remarks:
10533  This function implements an operation of the Busy feature.
10534  This feature may not be available on all devices. Please refer to the
10535  specific device data sheet to determine availability or use the
10536  PLIB_DMA_ExistsBusy function in your application to automatically
10537  determine whether this feature is available.
10538 */
10539 
10540 bool
10541  PLIB_DMA_IsBusy (
10542  DMA_MODULE_ID index ) ;
10543 //******************************************************************************
10544 /* Function:
10545  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
10546  Summary:
10547  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10548  Description:
10549  This function suspends the DMA transfers to allow uninterrupted access
10550  by the CPU to the data bus.
10551  Precondition:
10552  None.
10553  Parameters:
10554  None.
10555  Returns:
10556  None.
10557  Example:
10558  <code>
10559  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10560  </code>
10561  Remarks:
10562  This function implements an operation of the Suspend feature.
10563  This feature may not be available on all devices. Please refer to the
10564  specific device data sheet to determine availability or use the
10565  PLIB_DMA_ExistsSuspend function in your application to automatically
10566  determine whether this feature is available.
10567 */
10568 
10569 void
10571  DMA_MODULE_ID index ) ;
10572 //******************************************************************************
10573 /* Function:
10574  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10575  Summary:
10576  DMA suspend is disabled and the DMA module operates normally.
10577  Description:
10578  This function disables the DMA suspend. The DMA module continues to operate
10579  normally.
10580  Precondition:
10581  None.
10582  Parameters:
10583  None.
10584  Returns:
10585  None.
10586  Example:
10587  <code>
10588  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10589  </code>
10590  Remarks:
10591  This function implements an operation of the Suspend feature.
10592  This feature may not be available on all devices. Please refer to the
10593  specific device data sheet to determine availability or use the
10594  PLIB_DMA_ExistsSuspend function in your application to automatically
10595  determine whether this feature is available.
10596 */
10597 
10598 void
10600  DMA_MODULE_ID index ) ;
10601 //******************************************************************************
10602 /* Function:
10603  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10604  Summary:
10605  Returns the DMA suspend status.
10606  Description:
10607  This function returns the DMA suspend status.
10608  Precondition:
10609  None.
10610  Parameters:
10611  None.
10612  Returns:
10613  - true - The DMA transfers are suspended
10614  - false - The DMA operates normally
10615  Example:
10616  <code>
10617  bool dmaSuspendStatus;
10618  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10619  </code>
10620  Remarks:
10621  This function implements an operation of the Suspend feature.
10622  This feature may not be available on all devices. Please refer to the
10623  specific device data sheet to determine availability or use the
10624  PLIB_DMA_ExistsSuspend function in your application to automatically
10625  determine whether this feature is available.
10626 */
10627 
10628 bool
10630  DMA_MODULE_ID index ) ;
10631 //******************************************************************************
10632 /* Function:
10633  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10634  Summary:
10635  DMA transfers are halted during Idle mode.
10636  Description:
10637  This function halts DMA transfers during Idle mode.
10638  Precondition:
10639  None.
10640  Parameters:
10641  None.
10642  Returns:
10643  None.
10644  Example:
10645  <code>
10646  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10647  </code>
10648  Remarks:
10649  This function implements an operation of the StopInIdle feature.
10650  This feature may not be available on all devices. Please refer to the
10651  specific device data sheet to determine availability or use the
10652  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10653  determine whether this feature is available.
10654 */
10655 
10656 void
10658  DMA_MODULE_ID index ) ;
10659 //******************************************************************************
10660 /* Function:
10661  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10662  Summary:
10663  DMA transfers continue during Idle mode.
10664  Description:
10665  This function causes DMA transfers to continue during Idle mode.
10666  Precondition:
10667  None.
10668  Parameters:
10669  None.
10670  Returns:
10671  None.
10672  Example:
10673  <code>
10674  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10675  </code>
10676  Remarks:
10677  This function implements an operation of the StopInIdle feature.
10678  This feature may not be available on all devices. Please refer to the
10679  specific device data sheet to determine availability or use the
10680  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10681  determine whether this feature is available.
10682 */
10683 
10684 void
10686  DMA_MODULE_ID index ) ;
10687 //******************************************************************************
10688 /* Function:
10689  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10690  Summary:
10691  DMA module is enabled.
10692  Description:
10693  This function enables the DMA module.
10694  Precondition:
10695  None.
10696  Parameters:
10697  None.
10698  Returns:
10699  None.
10700  Example:
10701  <code>
10702  PLIB_DMA_Enable( DMA_ID_0 );
10703  </code>
10704  Remarks:
10705  This function implements an operation of the EnableControl feature.
10706  This feature may not be available on all devices. Please refer to the
10707  specific device data sheet to determine availability or use the
10708  PLIB_DMA_ExistsEnableControl function in your application to automatically
10709  determine whether this feature is available.
10710 */
10711 
10712 void
10713  PLIB_DMA_Enable (
10714  DMA_MODULE_ID index ) ;
10715 //******************************************************************************
10716 /* Function:
10717  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10718  Summary:
10719  Returns the DMA module enable status.
10720  Description:
10721  This function returns the DMA module enable status.
10722  Precondition:
10723  None.
10724  Parameters:
10725  None.
10726  Returns:
10727  - true - The DMA is enabled
10728  - false - The DMA is disabled
10729  Example:
10730  <code>
10731  PLIB_DMA_IsEnabled( DMA_ID_0 );
10732  </code>
10733  Remarks:
10734  This function implements an operation of the EnableControl feature.
10735  This feature may not be available on all devices. Please refer to the
10736  specific device data sheet to determine availability or use the
10737  PLIB_DMA_ExistsEnableControl function in your application to automatically
10738  determine whether this feature is available.
10739 */
10740 
10741 bool
10743  DMA_MODULE_ID index ) ;
10744 //******************************************************************************
10745 /* Function:
10746  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10747  Summary:
10748  DMA module is disabled.
10749  Description:
10750  This function disables the DMA module.
10751  Precondition:
10752  None.
10753  Parameters:
10754  None.
10755  Returns:
10756  None.
10757  Example:
10758  <code>
10759  PLIB_DMA_Disable( DMA_ID_0 );
10760  </code>
10761  Remarks:
10762  This function implements an operation of the EnableControl feature.
10763  This feature may not be available on all devices. Please refer to the
10764  specific device data sheet to determine availability or use the
10765  PLIB_DMA_ExistsEnableControl function in your application to automatically
10766  determine whether this feature is available.
10767 */
10768 
10769 void
10771  DMA_MODULE_ID index ) ;
10772 // *****************************************************************************
10773 // *****************************************************************************
10774 // Section: DMA status functions
10775 // *****************************************************************************
10776 // *****************************************************************************
10777 //******************************************************************************
10778 /* Function:
10779  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10780  Summary:
10781  Returns the DMA channel bits.
10782  Description:
10783  This function returns the channel bits.
10784  Precondition:
10785  None.
10786  Parameters:
10787  None.
10788  Returns:
10789  - uint8_t - DMA channel bits
10790  Example:
10791  <code>
10792  uint8_t dmaChBits;
10793  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10794  </code>
10795  Remarks:
10796  This function implements an operation of the ChannelBits feature.
10797  This feature may not be available on all devices. Please refer to the
10798  specific device data sheet to determine availability or use the
10799  PLIB_DMA_ExistsChannelBits function in your application to automatically
10800  determine whether this feature is available.
10801 */
10802 
10803 uint8_t
10805  DMA_MODULE_ID index ) ;
10806 //******************************************************************************
10807 /* Function:
10808  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10809  Summary:
10810  Returns true if the last DMA bus access was a read.
10811  Description:
10812  This function returns true if the last DMA bus access was a read.
10813  Precondition:
10814  None.
10815  Parameters:
10816  None.
10817  Returns:
10818  - true - The last bus access was a read
10819  - false - The last bus access was not a read
10820  Example:
10821  <code>
10822  bool dmaLastBusAccessType;
10823  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10824  </code>
10825  Remarks:
10826  This function implements an operation of the LastBusAccess feature.
10827  This feature may not be available on all devices. Please refer to the
10828  specific device data sheet to determine availability or use the
10829  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10830  determine whether this feature is available.
10831 */
10832 
10833 bool
10835  DMA_MODULE_ID index ) ;
10836 //******************************************************************************
10837 /* Function:
10838  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10839  Summary:
10840  Returns true if the last DMA bus access was a write.
10841  Description:
10842  This function returns true if the last DMA bus access was a write operation.
10843  Precondition:
10844  None.
10845  Parameters:
10846  None.
10847  Returns:
10848  - true - The last bus access was a write operation
10849  - false - The last bus access was not a write operation
10850  Example:
10851  <code>
10852  bool dmaLastBusAccessType;
10853  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10854  </code>
10855  Remarks:
10856  This function implements an operation of the LastBusAccess feature.
10857  This feature may not be available on all devices. Please refer to the
10858  specific device data sheet to determine availability or use the
10859  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10860  determine whether this feature is available.
10861 */
10862 
10863 bool
10865  DMA_MODULE_ID index ) ;
10866 //******************************************************************************
10867 /* Function:
10868  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10869  Summary:
10870  Returns the address of the most recent DMA access.
10871  Description:
10872  This function returns the address of the most recent DMA access.
10873  Precondition:
10874  None.
10875  Parameters:
10876  None.
10877  Returns:
10878  - uint32_t - The most recent address accessed by the DMA
10879  Example:
10880  <code>
10881  uint32_t dmaLastAddressAccessed;
10882  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10883  </code>
10884  Remarks:
10885  This function implements an operation of the RecentAddress feature.
10886  This feature may not be available on all devices. Please refer to the
10887  specific device data sheet to determine availability or use the
10888  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10889  determine whether this feature is available.
10890 */
10891 
10892 uint32_t
10894  DMA_MODULE_ID index ) ;
10895 // *****************************************************************************
10896 // *****************************************************************************
10897 // Section: DMA Module CRC Feature Interface Functions
10898 // *****************************************************************************
10899 // *****************************************************************************
10900 //******************************************************************************
10901 /* Function:
10902  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10903  DMA_CHANNEL channel )
10904  Summary:
10905  Assigns the CRC to the specified DMA channel.
10906  Description:
10907  This function assigns the CRC feature to the specified channel.
10908  Precondition:
10909  None.
10910  Parameters:
10911  channel - One of the possible DMA channels listed by DMA_CHANNEL
10912  Returns:
10913  None.
10914  Example:
10915  <code>
10916  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10917  DMA_CHANNEL_5 );
10918  </code>
10919  Remarks:
10920  This function implements an operation of the CRCChannel feature.
10921  This feature may not be available on all devices. Please refer to the
10922  specific device data sheet to determine availability or use the
10923  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10924  determine whether this feature is available.
10925 */
10926 
10927 void
10929  DMA_MODULE_ID index ,
10930  DMA_CHANNEL channel ) ;
10931 //******************************************************************************
10932 /* Function:
10933  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10934  Summary:
10935  Returns the current DMA channel to which the CRC is assigned.
10936  Description:
10937  This function returns the current DMA channel to which the CRC is assigned.
10938  Precondition:
10939  None.
10940  Parameters:
10941  None.
10942  Returns:
10943  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10944  Example:
10945  <code>
10946  DMA_CHANNEL crcChannel;
10947  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10948  </code>
10949  Remarks:
10950  This function implements an operation of the CRCChannel feature.
10951  This feature may not be available on all devices. Please refer to the
10952  specific device data sheet to determine availability or use the
10953  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10954  determine whether this feature is available.
10955 */
10956 
10957 DMA_CHANNEL
10959  DMA_MODULE_ID index ) ;
10960 //******************************************************************************
10961 /* Function:
10962  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10963  DMA_CRC_TYPE CRCType )
10964  Summary:
10965  Selects the DMA module CRC feature type.
10966  Description:
10967  This function selects the DMA module CRC feature type. The CRC feature will
10968  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10969  checksum.
10970  Precondition:
10971  None.
10972  Parameters:
10973  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10974  Returns:
10975  None.
10976  Example:
10977  <code>
10978  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10979  DMA_CRC_IP_HEADER );
10980  </code>
10981  Remarks:
10982  This function implements an operation of the CRCType feature.
10983  This feature may not be available on all devices. Please refer to the
10984  specific device data sheet to determine availability or use the
10985  PLIB_DMA_ExistsCRCType function in your application to automatically
10986  determine whether this feature is available.
10987 */
10988 
10989 void
10991  DMA_MODULE_ID index ,
10992  DMA_CRC_TYPE CRCType ) ;
10993 //******************************************************************************
10994 /* Function:
10995  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10996  Summary:
10997  Gets the current DMA module CRC feature type.
10998  Description:
10999  This function gets the DMA module CRC feature type. The CRC feature will
11000  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
11001  checksum.
11002  Precondition:
11003  None.
11004  Parameters:
11005  None.
11006  Returns:
11007  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
11008  Example:
11009  <code>
11010  DMA_CRC_TYPE CRCType;
11011  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
11012  </code>
11013  Remarks:
11014  This function implements an operation of the CRCType feature.
11015  This feature may not be available on all devices. Please refer to the
11016  specific device data sheet to determine availability or use the
11017  PLIB_DMA_ExistsCRCType function in your application to automatically
11018  determine whether this feature is available.
11019 */
11020 
11021 DMA_CRC_TYPE
11023  DMA_MODULE_ID index ) ;
11024 //******************************************************************************
11025 /* Function:
11026  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
11027  Summary:
11028  Enables the CRC append mode.
11029  Description:
11030  This function enables the CRC append mode. The DMA transfers data from the source
11031  into the CRC, but not to the destination. When a block transfer completes, the
11032  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
11033  Precondition:
11034  None.
11035  Parameters:
11036  None.
11037  Returns:
11038  None.
11039  Example:
11040  <code>
11041  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
11042  </code>
11043  Remarks:
11044  This function implements an operation of the CRCAppendMode feature.
11045  This feature may not be available on all devices. Please refer to the
11046  specific device data sheet to determine availability or use the
11047  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
11048  determine whether this feature is available.
11049 */
11050 
11051 void
11053  DMA_MODULE_ID index ) ;
11054 //******************************************************************************
11055 /* Function:
11056  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
11057  Summary:
11058  Gets the enable status of the CRC append mode.
11059  Description:
11060  This function gets the enable status of the CRC append mode.
11061  Precondition:
11062  None.
11063  Parameters:
11064  None.
11065  Returns:
11066  - true - CRC append mode is enabled
11067  - false - CRC append mode is disabled
11068  Example:
11069  <code>
11070  bool DMAcrcAppendMode;
11071  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
11072  </code>
11073  Remarks:
11074  This function implements an operation of the CRCAppendMode feature.
11075  This feature may not be available on all devices. Please refer to the
11076  specific device data sheet to determine availability or use the
11077  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
11078  determine whether this feature is available.
11079 */
11080 
11081 bool
11083  DMA_MODULE_ID index ) ;
11084 //******************************************************************************
11085 /* Function:
11086  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
11087  Summary:
11088  Disables the CRC append mode.
11089  Description:
11090  This function disables the CRC append mode. The DMA transfers data from the
11091  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
11092  as it writes the data to the destination.
11093  Precondition:
11094  None.
11095  Parameters:
11096  None.
11097  Returns:
11098  None.
11099  Example:
11100  <code>
11101  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
11102  </code>
11103  Remarks:
11104  This function implements an operation of the CRCAppendMode feature.
11105  This feature may not be available on all devices. Please refer to the
11106  specific device data sheet to determine availability or use the
11107  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
11108  determine whether this feature is available.
11109 */
11110 
11111 void
11113  DMA_MODULE_ID index ) ;
11114 //******************************************************************************
11115 /* Function:
11116  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
11117  Summary:
11118  Enables the DMA module CRC feature.
11119  Description:
11120  This function enables the DMA module CRC feature. The channel transfers are
11121  routed through the CRC.
11122  Precondition:
11123  None.
11124  Parameters:
11125  None.
11126  Returns:
11127  None.
11128  Example:
11129  <code>
11130  PLIB_DMA_CRCEnable( DMA_ID_0 );
11131  </code>
11132  Remarks:
11133  This function implements an operation of the CRC feature.
11134  This feature may not be available on all devices. Please refer to the
11135  specific device data sheet to determine availability or use the
11136  PLIB_DMA_ExistsCRC function in your application to automatically
11137  determine whether this feature is available.
11138 */
11139 
11140 void
11142  DMA_MODULE_ID index ) ;
11143 //******************************************************************************
11144 /* Function:
11145  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
11146  Summary:
11147  Gets the enable status of the CRC feature.
11148  Description:
11149  This function gets the enable status of the CRC feature.
11150  Precondition:
11151  None.
11152  Parameters:
11153  None.
11154  Returns:
11155  - true - The CRC feature is enabled
11156  - false - The CRC feature is disabled
11157  Example:
11158  <code>
11159  bool DMAcrcStatus;
11160  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
11161  </code>
11162  Remarks:
11163  This function implements an operation of the CRC feature.
11164  This feature may not be available on all devices. Please refer to the
11165  specific device data sheet to determine availability or use the
11166  PLIB_DMA_ExistsCRC function in your application to automatically
11167  determine whether this feature is available.
11168 */
11169 
11170 bool
11172  DMA_MODULE_ID index ) ;
11173 //******************************************************************************
11174 /* Function:
11175  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
11176  Summary:
11177  Disables the DMA module CRC feature.
11178  Description:
11179  This function disables the DMA module CRC feature. The channel transfers proceed
11180  normally.
11181  Precondition:
11182  None.
11183  Parameters:
11184  None.
11185  Returns:
11186  None.
11187  Example:
11188  <code>
11189  PLIB_DMA_CRCDisable( DMA_ID_0 );
11190  </code>
11191  Remarks:
11192  This function implements an operation of the CRC feature.
11193  This feature may not be available on all devices. Please refer to the
11194  specific device data sheet to determine availability or use the
11195  PLIB_DMA_ExistsCRC function in your application to automatically
11196  determine whether this feature is available.
11197 */
11198 
11199 void
11201  DMA_MODULE_ID index ) ;
11202 //******************************************************************************
11203 /* Function:
11204  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
11205  uint8_t polyLength )
11206  Summary:
11207  Selects the polynomial length.
11208  Description:
11209  This function Selects the polynomial length.
11210  Precondition:
11211  None.
11212  Parameters:
11213  polyLength - Polynomial length
11214  Returns:
11215  None.
11216  Example:
11217  <code>
11218  uint8_t polyLength = 0x2;
11219  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
11220  </code>
11221  Remarks:
11222  This function implements an operation of the CRCPolynomialLength feature.
11223  This feature may not be available on all devices. Please refer to the
11224  specific device data sheet to determine availability or use the
11225  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11226  determine whether this feature is available.
11227 */
11228 
11229 void
11231  DMA_MODULE_ID index ,
11232  uint8_t polyLength ) ;
11233 //******************************************************************************
11234 /* Function:
11235  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
11236  Summary:
11237  Gets the current polynomial length.
11238  Description:
11239  This function gets the current polynomial length.
11240  Precondition:
11241  None.
11242  Parameters:
11243  None.
11244  Returns:
11245  - uint8_t - Polynomial length
11246  Example:
11247  <code>
11248  uint8_t polyLength;
11249  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
11250  </code>
11251  Remarks:
11252  This function implements an operation of the CRCPolynomialLength feature.
11253  This feature may not be available on all devices. Please refer to the
11254  specific device data sheet to determine availability or use the
11255  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11256  determine whether this feature is available.
11257 */
11258 
11259 uint8_t
11261  DMA_MODULE_ID index ) ;
11262 //******************************************************************************
11263 /* Function:
11264  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
11265  DMA_CRC_BIT_ORDER bitOrder )
11266  Summary:
11267  Selects the bit order for checksum calculation.
11268  Description:
11269  This function selects the bit order for checksum calculation.
11270  Precondition:
11271  None.
11272  Parameters:
11273  bitOrder - Specifies the bit order for CRC calculation
11274  Returns:
11275  None.
11276  Example:
11277  <code>
11278  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
11279  </code>
11280  Remarks:
11281  This function implements an operation of the CRCBitOrder feature.
11282  This feature may not be available on all devices. Please refer to the
11283  specific device data sheet to determine availability or use the
11284  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
11285  determine whether this feature is available.
11286 */
11287 
11288 void
11290  DMA_MODULE_ID index ,
11291  DMA_CRC_BIT_ORDER bitOrder ) ;
11292 //******************************************************************************
11293 /* Function:
11294  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
11295  Summary:
11296  The source data is written to the destination reordered as defined by the
11297  BYTO<1:0> bits.
11298  Description:
11299  This function enables byte order alteration as specified by the BYTO<1:0> bits.
11300  The source data is written to the destination reordered as defined by the
11301  BYTO<1:0> bits.
11302  Precondition:
11303  None.
11304  Parameters:
11305  None.
11306  Returns:
11307  None.
11308  Example:
11309  <code>
11310  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
11311  </code>
11312  Remarks:
11313  This function implements an operation of the CRCWriteByteOrder feature.
11314  This feature may not be available on all devices. Please refer to the
11315  specific device data sheet to determine availability or use the
11316  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11317  determine whether this feature is available.
11318 */
11319 
11320 void
11322  DMA_MODULE_ID index ) ;
11323 //******************************************************************************
11324 /* Function:
11325  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
11326  Summary:
11327  The source data is written to the destination unaltered.
11328  Description:
11329  This function disables byte order alteration. The source data is written
11330  to the destination unaltered.
11331  Precondition:
11332  None.
11333  Parameters:
11334  None.
11335  Returns:
11336  None.
11337  Example:
11338  <code>
11339  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
11340  </code>
11341  Remarks:
11342  This function implements an operation of the CRCWriteByteOrder feature.
11343  This feature may not be available on all devices. Please refer to the
11344  specific device data sheet to determine availability or use the
11345  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11346  determine whether this feature is available.
11347 */
11348 
11349 void
11351  DMA_MODULE_ID index ) ;
11352 //******************************************************************************
11353 /* Function:
11354  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
11355  DMA_CRC_BYTE_ORDER byteOrder )
11356  Summary:
11357  Selects the byte order.
11358  Description:
11359  This function selects the byte order.
11360  Precondition:
11361  The WBO bit must be set to use this function.
11362  Parameters:
11363  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11364  Returns:
11365  None.
11366  Example:
11367  <code>
11368  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
11369  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
11370  </code>
11371  Remarks:
11372  This function implements an operation of the CRCByteOrder feature.
11373  This feature may not be available on all devices. Please refer to the
11374  specific device data sheet to determine availability or use the
11375  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11376  determine whether this feature is available.
11377 */
11378 
11379 void
11381  DMA_MODULE_ID index ,
11382  DMA_CRC_BYTE_ORDER byteOrder ) ;
11383 //******************************************************************************
11384 /* Function:
11385  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
11386  Summary:
11387  Gets the current byte order selected by the DMA module CRC feature.
11388  Description:
11389  This function gets the current byte order selected by the DMA module CRC feature.
11390  Precondition:
11391  The WBO bit must be set to use this function.
11392  Parameters:
11393  None.
11394  Returns:
11395  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11396  Example:
11397  <code>
11398  DMA_CRC_BYTE_ORDER byteOrder;
11399  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
11400  </code>
11401  Remarks:
11402  This function implements an operation of the CRCByteOrder feature.
11403  This feature may not be available on all devices. Please refer to the
11404  specific device data sheet to determine availability or use the
11405  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11406  determine whether this feature is available.
11407 */
11408 
11409 DMA_CRC_BYTE_ORDER
11411  DMA_MODULE_ID index ) ;
11412 //******************************************************************************
11413 /* Function:
11414  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
11415  Summary:
11416  Reads the contents of the DMA CRC data register.
11417  Description:
11418  This function reads the contents of the DMA CRC data register.
11419  Precondition:
11420  None.
11421  Parameters:
11422  None.
11423  Returns:
11424  - uint32_t - 32-bit CRC data
11425  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11426  device data sheet to determine availability.
11427  Example:
11428  <code>
11429  uint32_t DMACRCdata;
11430  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
11431  </code>
11432  Remarks:
11433  This function implements an operation of the CRCData feature.
11434  This feature may not be available on all devices. Please refer to the
11435  specific device data sheet to determine availability or use the
11436  PLIB_DMA_ExistsCRCData function in your application to automatically
11437  determine whether this feature is available.
11438 */
11439 
11440 uint32_t
11442  DMA_MODULE_ID index ) ;
11443 //******************************************************************************
11444 /* Function:
11445  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
11446  uint32_t DMACRCdata )
11447  Summary:
11448  Writes the contents of the DMA CRC data register with the specified data.
11449  Description:
11450  This function writes the contents of the DMA CRC data register.
11451  Precondition:
11452  None.
11453  Parameters:
11454  - DMACRCdata - 32-bit CRC data
11455  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11456  device data sheet to determine availability.
11457  Returns:
11458  None.
11459  Example:
11460  <code>
11461  uint32_t DMACRCdata = 0x0E0E0E;
11462  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
11463  </code>
11464  Remarks:
11465  This function implements an operation of the CRCData feature.
11466  This feature may not be available on all devices. Please refer to the
11467  specific device data sheet to determine availability or use the
11468  PLIB_DMA_ExistsCRCData function in your application to automatically
11469  determine whether this feature is available.
11470 */
11471 
11472 void
11474  DMA_MODULE_ID index ,
11475  uint32_t DMACRCdata ) ;
11476 //******************************************************************************
11477 /* Function:
11478  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
11479  Summary:
11480  Reads the CRC XOR register.
11481  Description:
11482  This function reads the CRC XOR register.
11483  Precondition:
11484  None.
11485  Parameters:
11486  None.
11487  Returns:
11488  - uint32_t - 32-bit CRC XOR enable mask data
11489  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11490  device data sheet to determine availability.
11491  Example:
11492  <code>
11493  uint32_t DMACRCXORdata;
11494  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
11495  </code>
11496  Remarks:
11497  This function implements an operation of the CRCXOREnable feature.
11498  This feature may not be available on all devices. Please refer to the
11499  specific device data sheet to determine availability or use the
11500  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11501  determine whether this feature is available.
11502 */
11503 
11504 uint32_t
11506  DMA_MODULE_ID index ) ;
11507 //******************************************************************************
11508 /* Function:
11509  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
11510  uint32_t DMACRCXOREnableMask )
11511  Summary:
11512  Writes to the CRC XOR enable register as per the specified enable mask.
11513  Description:
11514  This function writes to the CRC XOR enable register as per the specified
11515  enable mask. Each enabled bit will be taken as input to the shift register.
11516  Precondition:
11517  None.
11518  Parameters:
11519  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
11520  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11521  device data sheet to determine availability.
11522  Returns:
11523  None.
11524  Example:
11525  <code>
11526  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
11527  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
11528  </code>
11529  Remarks:
11530  This function implements an operation of the CRCXOREnable feature.
11531  This feature may not be available on all devices. Please refer to the
11532  specific device data sheet to determine availability or use the
11533  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11534  determine whether this feature is available.
11535 */
11536 
11537 void
11539  DMA_MODULE_ID index ,
11540  uint32_t DMACRCXOREnableMask ) ;
11541 // *****************************************************************************
11542 // *****************************************************************************
11543 // Section: DMA Address control Interface functions
11544 // *****************************************************************************
11545 // *****************************************************************************
11546 //******************************************************************************
11547 /* Function:
11548  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11549  DMA_CHANNEL dmaChannel )
11550  Summary:
11551  Reads the source start address configured for the specified channel.
11552  Description:
11553  This function reads the source start address configured for the specified
11554  channel.
11555  Precondition:
11556  None.
11557  Parameters:
11558  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11559  Returns:
11560  - uint32_t - The source start address configured for this channel
11561  Example:
11562  <code>
11563  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11564  uint32_t SourceStartAddress;
11565  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11566  spiDMAChannel );
11567  </code>
11568  Remarks:
11569  This function implements an operation of the ChannelXSourceStartAddress feature.
11570  This feature may not be available on all devices. Please refer to the
11571  specific device data sheet to determine availability or use the
11572  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11573  determine whether this feature is available.
11574 */
11575 
11576 uint32_t
11578  DMA_MODULE_ID index ,
11579  DMA_CHANNEL dmaChannel ) ;
11580 //******************************************************************************
11581 /* Function:
11582  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11583  DMA_CHANNEL dmaChannel,
11584  uint32_t sourceStartAddress)
11585  Summary:
11586  Writes the specified source start address into the register
11587  corresponding to the specified channel.
11588  Description:
11589  This function writes the specified Source start address into the register
11590  corresponding to the specified channel.
11591  Precondition:
11592  None.
11593  Parameters:
11594  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11595  sourceStartAddress - The source start address
11596  Returns:
11597  None.
11598  Example:
11599  <code>
11600  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11601  uint32_t sourceStartAddress = 0x00FDEA00;
11602  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11603  spiDMAChannel,
11604  sourceStartAddress );
11605  </code>
11606  Remarks:
11607  This function implements an operation of the ChannelXSourceStartAddress feature.
11608  This feature may not be available on all devices. Please refer to the
11609  specific device data sheet to determine availability or use the
11610  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11611  determine whether this feature is available.
11612 */
11613 
11614 void
11616  DMA_MODULE_ID index ,
11617  DMA_CHANNEL dmaChannel ,
11618  uint32_t sourceStartAddress ) ;
11619 //******************************************************************************
11620 /* Function:
11621  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11622  DMA_CHANNEL dmaChannel )
11623  Summary:
11624  Reads the destination start address configured for the specified channel.
11625  Description:
11626  This function reads the destination start address configured for the specified
11627  channel.
11628  Precondition:
11629  None.
11630  Parameters:
11631  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11632  Returns:
11633  - uint32_t - The destination start address configured for this channel
11634  Example:
11635  <code>
11636  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11637  uint32_t DestinationStartAddress;
11638  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11639  DMA_ID_0,
11640  spiDMAChannel );
11641  </code>
11642  Remarks:
11643  This function implements an operation of the ChannelXDestinationStartAddress feature.
11644  This feature may not be available on all devices. Please refer to the
11645  specific device data sheet to determine availability or use the
11646  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11647  determine whether this feature is available.
11648 */
11649 
11650 uint32_t
11652  DMA_MODULE_ID index ,
11653  DMA_CHANNEL dmaChannel ) ;
11654 //******************************************************************************
11655 /* Function:
11656  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11657  DMA_MODULE_ID index,
11658  DMA_CHANNEL dmaChannel,
11659  uint32_t destinationStartAddress)
11660  Summary:
11661  Writes the specified destination start address into the register corresponding to
11662  the specified channel.
11663  Description:
11664  This function writes the specified destination start address into the register
11665  corresponding to the specified channel.
11666  Precondition:
11667  None.
11668  Parameters:
11669  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11670  destinationStartAddress - The destination start address
11671  Returns:
11672  None.
11673  Example:
11674  <code>
11675  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11676  uint32_t destinationStartAddress = 0x00FDEA00;
11677  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11678  spiDMAChannel,
11679  destinationStartAddress );
11680  </code>
11681  Remarks:
11682  This function implements an operation of the ChannelXDestinationStartAddress feature.
11683  This feature may not be available on all devices. Please refer to the
11684  specific device data sheet to determine availability or use the
11685  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11686  determine whether this feature is available.
11687 */
11688 
11689 void
11691  DMA_MODULE_ID index ,
11692  DMA_CHANNEL dmaChannel ,
11693  uint32_t destinationStartAddress ) ;
11694 // *****************************************************************************
11695 // *****************************************************************************
11696 // Section: DMA Data control Interface functions
11697 // *****************************************************************************
11698 // *****************************************************************************
11699 //******************************************************************************
11700 /* Function:
11701  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11702  DMA_CHANNEL dmaChannel )
11703  Summary:
11704  Reads the source size configured for the specified channel.
11705  Description:
11706  This function reads the source size configured for the specified
11707  channel.
11708  Precondition:
11709  None.
11710  Parameters:
11711  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11712  Returns:
11713  - uint16_t - The Source size configured (in bytes) for this channel.
11714  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11715  device data sheet to determine availability.
11716  Example:
11717  <code>
11718  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11719  uint16_t sourceSize;
11720  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11721  spiDMAChannel );
11722  </code>
11723  Remarks:
11724  This function implements an operation of the ChannelXSourceSize feature.
11725  This feature may not be available on all devices. Please refer to the
11726  specific device data sheet to determine availability or use the
11727  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11728  determine whether this feature is available.
11729 */
11730 
11731 uint16_t
11733  DMA_MODULE_ID index ,
11734  DMA_CHANNEL dmaChannel ) ;
11735 //******************************************************************************
11736 /* Function:
11737  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11738  DMA_CHANNEL dmaChannel,
11739  uint16_t sourceSize)
11740  Summary:
11741  Writes the specified source size into the register corresponding
11742  to the specified channel.
11743  Description:
11744  This function writes the specified source size into the register
11745  corresponding to the specified channel.
11746  Precondition:
11747  None.
11748  Parameters:
11749  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11750  sourceSize - The source size. The source size (8-bit, 16-bit) is
11751  device-specific. Please refer to the specific device data
11752  sheet to determine availability.
11753  Returns:
11754  None.
11755  Example:
11756  <code>
11757  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11758  uint16_t sourceSize = 0xA00;
11759  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11760  spiDMAChannel,
11761  sourceSize );
11762  </code>
11763  Remarks:
11764  This function implements an operation of the ChannelXSourceSize feature.
11765  This feature may not be available on all devices. Please refer to the
11766  specific device data sheet to determine availability or use the
11767  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11768  determine whether this feature is available.
11769 */
11770 
11771 void
11773  DMA_MODULE_ID index ,
11774  DMA_CHANNEL dmaChannel ,
11775  uint16_t sourceSize ) ;
11776 //******************************************************************************
11777 /* Function:
11778  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11779  DMA_CHANNEL dmaChannel )
11780  Summary:
11781  Reads the destination size configured for the specified channel.
11782  Description:
11783  This function reads the destination size configured for the specified
11784  channel.
11785  Precondition:
11786  None.
11787  Parameters:
11788  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11789  Returns:
11790  - uint16_t - The destination size configured (in bytes) for this channel.
11791  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11792  device data sheet to determine availability.
11793  Example:
11794  <code>
11795  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11796  uint16_t DestinationSize;
11797  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11798  spiDMAChannel );
11799  </code>
11800  Remarks:
11801  This function implements an operation of the ChannelXDestinationSize feature.
11802  This feature may not be available on all devices. Please refer to the
11803  specific device data sheet to determine availability or use the
11804  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11805  determine whether this feature is available.
11806 */
11807 
11808 uint16_t
11810  DMA_MODULE_ID index ,
11811  DMA_CHANNEL dmaChannel ) ;
11812 //******************************************************************************
11813 /* Function:
11814  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11815  DMA_CHANNEL dmaChannel,
11816  uint16_t destinationSize)
11817  Summary:
11818  Writes the specified destination size into the register corresponding
11819  to the specified channel.
11820  Description:
11821  This function writes the specified destination size into the register
11822  corresponding to the specified channel.
11823  Precondition:
11824  None.
11825  Parameters:
11826  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11827  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11828  is device-specific. Please refer to the specific device
11829  data sheet to determine availability.)
11830  Returns:
11831  None.
11832  Example:
11833  <code>
11834  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11835  uint16_t destinationSize = 0xA00;
11836  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11837  </code>
11838  Remarks:
11839  This function implements an operation of the ChannelXDestinationSize feature.
11840  This feature may not be available on all devices. Please refer to the
11841  specific device data sheet to determine availability or use the
11842  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11843  determine whether this feature is available.
11844 */
11845 
11846 void
11848  DMA_MODULE_ID index ,
11849  DMA_CHANNEL dmaChannel ,
11850  uint16_t destinationSize ) ;
11851 //******************************************************************************
11852 /* Function:
11853  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11854  DMA_CHANNEL dmaChannel )
11855  Summary:
11856  Reads the current byte of the source being pointed to for the specified channel.
11857  Description:
11858  This function reads the current byte of the source being pointed to for the
11859  specified channel.
11860  Precondition:
11861  None.
11862  Parameters:
11863  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11864  Returns:
11865  - uint16_t - The source byte being pointed to for this channel.
11866  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11867  device data sheet to determine availability.
11868  Example:
11869  <code>
11870  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11871  uint16_t sourcebyte;
11872  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11873  </code>
11874  Remarks:
11875  This function implements an operation of the ChannelXSourcePointer feature.
11876  This feature may not be available on all devices. Please refer to the
11877  specific device data sheet to determine availability or use the
11878  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11879  determine whether this feature is available.
11880 */
11881 
11882 uint16_t
11884  DMA_MODULE_ID index ,
11885  DMA_CHANNEL dmaChannel ) ;
11886 //******************************************************************************
11887 /* Function:
11888  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11889  DMA_CHANNEL dmaChannel )
11890  Summary:
11891  Reads the current byte of the destination being pointed to for the specified channel.
11892  Description:
11893  This function reads the current byte of the destination being pointed to for the
11894  specified channel.
11895  Precondition:
11896  None.
11897  Parameters:
11898  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11899  Returns:
11900  - uint16_t - The destination byte being pointed to for this channel.
11901  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11902  device data sheet to determine availability.
11903  Example:
11904  <code>
11905  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11906  uint16_t destinationbyte;
11907  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11908  spiDMAChannel );
11909  </code>
11910  Remarks:
11911  This function implements an operation of the ChannelXDestinationPointer feature.
11912  This feature may not be available on all devices. Please refer to the
11913  specific device data sheet to determine availability or use the
11914  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11915  determine whether this feature is available.
11916 */
11917 
11918 uint16_t
11920  DMA_MODULE_ID index ,
11921  DMA_CHANNEL dmaChannel ) ;
11922 //******************************************************************************
11923 /* Function:
11924  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11925  DMA_CHANNEL dmaChannel )
11926  Summary:
11927  Reads the cell size (in bytes) configured for the specified channel.
11928  Description:
11929  This function reads the cell size (in bytes) configured for the specified
11930  channel.
11931  Precondition:
11932  None.
11933  Parameters:
11934  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11935  Returns:
11936  - uint16_t - The cell size configured (in bytes) for this channel
11937  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11938  device data sheet to determine availability.
11939  Example:
11940  <code>
11941  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11942  uint16_t cellSize;
11943  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11944  spiDMAChannel );
11945  </code>
11946  Remarks:
11947  This function implements an operation of the ChannelXCellSize feature.
11948  This feature may not be available on all devices. Please refer to the
11949  specific device data sheet to determine availability or use the
11950  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11951  determine whether this feature is available.
11952 */
11953 
11954 uint16_t
11956  DMA_MODULE_ID index ,
11957  DMA_CHANNEL dmaChannel ) ;
11958 //******************************************************************************
11959 /* Function:
11960  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11961  DMA_CHANNEL dmaChannel,
11962  uint16_t cellSize)
11963  Summary:
11964  Writes the specified cell size into the register corresponding
11965  to the specified channel.
11966  Description:
11967  This function writes the specified cell size into the register
11968  corresponding to the specified channel.
11969  Precondition:
11970  None.
11971  Parameters:
11972  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11973  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11974  device-specific. Please refer to the specific device data
11975  sheet to determine availability.)
11976  Returns:
11977  None.
11978  Example:
11979  <code>
11980  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11981  uint16_t cellSize = 0x10;
11982  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11983  </code>
11984  Remarks:
11985  This function implements an operation of the ChannelXCellSize feature.
11986  This feature may not be available on all devices. Please refer to the
11987  specific device data sheet to determine availability or use the
11988  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11989  determine whether this feature is available.
11990 */
11991 
11992 void
11994  DMA_MODULE_ID index ,
11995  DMA_CHANNEL dmaChannel ,
11996  uint16_t CellSize ) ;
11997 //******************************************************************************
11998 /* Function:
11999  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
12000  DMA_CHANNEL dmaChannel )
12001  Summary:
12002  Returns the number of bytes transferred since the last event.
12003  Description:
12004  This function returns the number of bytes transferred since the last event.
12005  Precondition:
12006  None.
12007  Parameters:
12008  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12009  Returns:
12010  - uint16_t - The number of bytes transferred since the last event.
12011  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
12012  the specific device data sheet to determine availability.
12013  Example:
12014  <code>
12015  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12016  uint16_t CellProgress;
12017  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
12018  spiDMAChannel );
12019  </code>
12020  Remarks:
12021  This function implements an operation of the ChannelXCellProgressPointer feature.
12022  This feature may not be available on all devices. Please refer to the
12023  specific device data sheet to determine availability or use the
12024  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
12025  determine whether this feature is available.
12026 */
12027 
12028 uint16_t
12030  DMA_MODULE_ID index ,
12031  DMA_CHANNEL dmaChannel ) ;
12032 //******************************************************************************
12033 /* Function:
12034  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
12035  DMA_CHANNEL dmaChannel )
12036  Summary:
12037  Returns the pattern matching (for DMA abort) data programmed for the specified
12038  channel.
12039  Description:
12040  This function returns pattern matching (for DMA abort) data programmed for
12041  the specified channel.
12042  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
12043  the specific device data sheet to determine availability.)
12044  Precondition:
12045  None.
12046  Parameters:
12047  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12048  Returns:
12049  - uint16_t - The pattern matching data programmed for the current channel.
12050  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
12051  the specific device data sheet to determine availability.
12052  Example:
12053  <code>
12054  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12055  uint16_t patternData;
12056  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
12057  </code>
12058  Remarks:
12059  This function implements an operation of the ChannelXPatternData feature.
12060  This feature may not be available on all devices. Please refer to the
12061  specific device data sheet to determine availability or use the
12062  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
12063  determine whether this feature is available.
12064 */
12065 
12066 uint16_t
12068  DMA_MODULE_ID index ,
12069  DMA_CHANNEL dmaChannel ) ;
12070 //******************************************************************************
12071 /* Function:
12072  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
12073  DMA_CHANNEL dmaChannel,
12074  uint16_t patternData)
12075  Summary:
12076  Writes the specified pattern matching data (for DMA abort) into the register
12077  corresponding to the specified channel.
12078  Description:
12079  This function writes the specified pattern matching data (for DMA abort) into the
12080  register corresponding to the specified channel.
12081  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
12082  the specific device data sheet to determine availability.)
12083  Precondition:
12084  None.
12085  Parameters:
12086  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12087  patternData - The pattern matching DATA programmed for the current channel
12088  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
12089  the specific device data sheet to determine availability.)
12090  Returns:
12091  None.
12092  Example:
12093  <code>
12094  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12095  uint16_t patternData = '\0';
12096  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
12097  </code>
12098  Remarks:
12099  This function implements an operation of the ChannelXPatternData feature.
12100  This feature may not be available on all devices. Please refer to the
12101  specific device data sheet to determine availability or use the
12102  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
12103  determine whether this feature is available.
12104 */
12105 
12106 void
12108  DMA_MODULE_ID index ,
12109  DMA_CHANNEL dmaChannel ,
12110  uint16_t patternData ) ;
12111 // *****************************************************************************
12112 // *****************************************************************************
12113 // Section: DMA Interrupt Control Interface functions
12114 // *****************************************************************************
12115 // *****************************************************************************
12116 //******************************************************************************
12117 /* Function:
12118  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
12119  DMA_CHANNEL dmaChannel,
12120  DMA_INT_TYPE dmaINTSource )
12121  Summary:
12122  Returns the status of the interrupt flag of the specified DMA interrupt source
12123  for the specified channel.
12124  Description:
12125  This function returns the status of the interrupt flag of the specified DMA interrupt
12126  source for the specified channel.
12127  Precondition:
12128  None.
12129  Parameters:
12130  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12131  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12132  Returns:
12133  - true - The interrupt flag is set
12134  - false - The interrupt flag is not set
12135  Example:
12136  <code>
12137  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12138  bool AddressErrorINTStatus;
12139  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
12140  DMA_ID_0,
12141  spiDMAChannel,
12142  DMA_INT_ADDRESS_ERROR );
12143  </code>
12144  Remarks:
12145  This function implements an operation of the ChannelXINTSourceFlag feature.
12146  This feature may not be available on all devices. Please refer to the
12147  specific device data sheet to determine availability or use the
12148  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12149  determine whether this feature is available.
12150 */
12151 
12152 bool
12154  DMA_MODULE_ID index ,
12155  DMA_CHANNEL dmaChannel ,
12156  DMA_INT_TYPE dmaINTSource ) ;
12157 //******************************************************************************
12158 /* Function:
12159  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
12160  DMA_CHANNEL dmaChannel,
12161  DMA_INT_TYPE dmaINTSource )
12162  Summary:
12163  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
12164  Description:
12165  This function sets the interrupt flag of the specified DMA interrupt source for
12166  the specified channel.
12167  Precondition:
12168  None.
12169  Parameters:
12170  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12171  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12172  Returns:
12173  None.
12174  Example:
12175  <code>
12176  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12177  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
12178  spiDMAChannel,
12179  DMA_INT_ADDRESS_ERROR );
12180  </code>
12181  Remarks:
12182  This function implements an operation of the ChannelXINTSourceFlag feature.
12183  This feature may not be available on all devices. Please refer to the
12184  specific device data sheet to determine availability or use the
12185  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12186  determine whether this feature is available.
12187 */
12188 
12189 void
12191  DMA_MODULE_ID index ,
12192  DMA_CHANNEL dmaChannel ,
12193  DMA_INT_TYPE dmaINTSource ) ;
12194 //******************************************************************************
12195 /* Function:
12196  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
12197  DMA_CHANNEL dmaChannel,
12198  DMA_INT_TYPE dmaINTSource )
12199  Summary:
12200  Clears the interrupt flag of the specified DMA interrupt source
12201  for the specified channel.
12202  Description:
12203  This function clears the interrupt flag of the specified DMA interrupt source
12204  for the specified channel.
12205  Precondition:
12206  None.
12207  Parameters:
12208  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12209  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12210  Returns:
12211  None.
12212  Example:
12213  <code>
12214  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12215  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
12216  spiDMAChannel,
12217  DMA_INT_ADDRESS_ERROR );
12218  </code>
12219  Remarks:
12220  This function implements an operation of the ChannelXINTSourceFlag feature.
12221  This feature may not be available on all devices. Please refer to the
12222  specific device data sheet to determine availability or use the
12223  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12224  determine whether this feature is available.
12225 */
12226 
12227 void
12229  DMA_MODULE_ID index ,
12230  DMA_CHANNEL dmaChannel ,
12231  DMA_INT_TYPE dmaINTSource ) ;
12232 //******************************************************************************
12233 /* Function:
12234  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
12235  DMA_CHANNEL dmaChannel,
12236  DMA_INT_TYPE dmaINTSource )
12237  Summary:
12238  Enables the specified interrupt source for the specified channel.
12239  Description:
12240  This function enables the specified interrupt source for the specified channel.
12241  Precondition:
12242  None.
12243  Parameters:
12244  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12245  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12246  Returns:
12247  None.
12248  Example:
12249  <code>
12250  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12251  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
12252  spiDMAChannel,
12253  DMA_INT_ADDRESS_ERROR );
12254  </code>
12255  Remarks:
12256  This function implements an operation of the ChannelXINTSource feature.
12257  This feature may not be available on all devices. Please refer to the
12258  specific device data sheet to determine availability or use the
12259  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12260  determine whether this feature is available.
12261 */
12262 
12263 void
12265  DMA_MODULE_ID index ,
12266  DMA_CHANNEL dmaChannel ,
12267  DMA_INT_TYPE dmaINTSource ) ;
12268 //******************************************************************************
12269 /* Function:
12270  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
12271  DMA_CHANNEL dmaChannel,
12272  DMA_INT_TYPE dmaINTSource )
12273  Summary:
12274  Disables the specified interrupt source for the specified channel.
12275  Description:
12276  This function disables the specified interrupt source for the specified channel.
12277  Precondition:
12278  None.
12279  Parameters:
12280  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12281  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12282  Returns:
12283  None.
12284  Example:
12285  <code>
12286  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12287  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
12288  spiDMAChannel,
12289  DMA_INT_ADDRESS_ERROR );
12290  </code>
12291  Remarks:
12292  This function implements an operation of the ChannelXINTSource feature.
12293  This feature may not be available on all devices. Please refer to the
12294  specific device data sheet to determine availability or use the
12295  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12296  determine whether this feature is available.
12297 */
12298 
12299 void
12301  DMA_MODULE_ID index ,
12302  DMA_CHANNEL dmaChannel ,
12303  DMA_INT_TYPE dmaINTSource ) ;
12304 //******************************************************************************
12305 /* Function:
12306  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
12307  DMA_CHANNEL dmaChannel,
12308  DMA_INT_TYPE dmaINTSource )
12309  Summary:
12310  Returns the enable status of the specified interrupt source for the specified channel.
12311  Description:
12312  This function returns the enable status of the specified interrupt source for the
12313  specified channel.
12314  Precondition:
12315  None.
12316  Parameters:
12317  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12318  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12319  Returns:
12320  - true - The interrupt is enabled
12321  - false - The interrupt is not enabled
12322  Example:
12323  <code>
12324  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12325  bool dmaINTSourceEnableStatus;
12326  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
12327  DMA_ID_0,
12328  spiDMAChannel,
12329  DMA_INT_ADDRESS_ERROR );
12330  </code>
12331  Remarks:
12332  This function implements an operation of the ChannelXINTSource feature.
12333  This feature may not be available on all devices. Please refer to the
12334  specific device data sheet to determine availability or use the
12335  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12336  determine whether this feature is available.
12337 */
12338 
12339 bool
12341  DMA_MODULE_ID index ,
12342  DMA_CHANNEL dmaChannel ,
12343  DMA_INT_TYPE dmaINTSource ) ;
12344 //******************************************************************************
12345 /* Function:
12346  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
12347  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
12348  Summary:
12349  Sets the pattern match length.
12350  Description:
12351  This function sets the length of the pattern match ignore to 1 or 2 bytes.
12352  Precondition:
12353  None.
12354  Parameters:
12355  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12356  patternLen - Length of pattern match (either 1 or 2)
12357  Returns:
12358  None.
12359  Example:
12360  <code>
12361  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12362  DMA_PATTERN_LENGTH patternLen;
12363  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
12364  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
12365  </code>
12366  Remarks:
12367  This function implements an operation of the ChannelXPatternLength feature.
12368  This feature may not be available on all devices. Please refer to the
12369  specific device data sheet to determine availability or use the
12370  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12371  determine whether this feature is available.
12372 */
12373 
12374 void
12376  DMA_MODULE_ID index ,
12377  DMA_CHANNEL dmaChannel ,
12378  DMA_PATTERN_LENGTH patternLen ) ;
12379 //******************************************************************************
12380 /* Function:
12381  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
12382  DMA_CHANNEL dmaChannel);
12383  Summary:
12384  Returns the pattern match length.
12385  Description:
12386  This function returns the length of the byte matching the CHPIGN bits during a
12387  pattern match that may be ignored during the pattern match determination when
12388  the CHPIGNEN bit is set.
12389  Precondition:
12390  None.
12391  Parameters:
12392  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12393  Returns:
12394  - patternLen - Length of pattern match (either 1 or 2)
12395  Example:
12396  <code>
12397  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12398  DMA_PATTERN_LENGTH patternLen;
12399  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
12400  </code>
12401  Remarks:
12402  This function implements an operation of the ChannelXPatternLength feature.
12403  This feature may not be available on all devices. Please refer to the
12404  specific device data sheet to determine availability or use the
12405  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12406  determine whether this feature is available.
12407 */
12408 
12409 DMA_PATTERN_LENGTH
12411  DMA_MODULE_ID index ,
12412  DMA_CHANNEL dmaChannel ) ;
12413 //******************************************************************************
12414 /* Function:
12415  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
12416  DMA_CHANNEL channel );
12417  Summary:
12418  Enables the pattern match ignore byte.
12419  Description:
12420  This function enables the pattern match ignore byte.
12421  Precondition:
12422  None.
12423  Parameters:
12424  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12425  Returns:
12426  None.
12427  Example:
12428  <code>
12429  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12430  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
12431  </code>
12432  Remarks:
12433  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12434  This feature may not be available on all devices. Please refer to the
12435  specific device data sheet to determine availability or use the
12436  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12437  determine whether this feature is available.
12438 */
12439 
12440 void
12442  DMA_MODULE_ID index ,
12443  DMA_CHANNEL channel ) ;
12444 //******************************************************************************
12445 /* Function:
12446  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
12447  DMA_CHANNEL channel );
12448  Summary:
12449  Returns the state of the pattern match ignore byte.
12450  Description:
12451  This function returns the state (enabled or disabled) of the pattern match
12452  ignore byte.
12453  Precondition:
12454  None.
12455  Parameters:
12456  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12457  Returns:
12458  - true - The pattern match ignore byte is enabled
12459  - false - The pattern match ignore byte is disabled
12460  Example:
12461  <code>
12462  bool patternIsEnabled;
12463  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12464  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
12465  </code>
12466  Remarks:
12467  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12468  This feature may not be available on all devices. Please refer to the
12469  specific device data sheet to determine availability or use the
12470  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12471  determine whether this feature is available.
12472 */
12473 
12474 bool
12476  DMA_MODULE_ID index ,
12477  DMA_CHANNEL channel ) ;
12478 //******************************************************************************
12479 /* Function:
12480  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
12481  DMA_CHANNEL channel );
12482  Summary:
12483  Disables the pattern match ignore byte.
12484  Description:
12485  This function disables the pattern match ignore byte.
12486  Precondition:
12487  None.
12488  Parameters:
12489  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12490  Returns:
12491  None.
12492  Example:
12493  <code>
12494  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12495  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
12496  </code>
12497  Remarks:
12498  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12499  This feature may not be available on all devices. Please refer to the
12500  specific device data sheet to determine availability or use the
12501  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12502  determine whether this feature is available.
12503 */
12504 
12505 void
12507  DMA_MODULE_ID index ,
12508  DMA_CHANNEL channel ) ;
12509 //******************************************************************************
12510 /* Function:
12511  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
12512  DMA_CHANNEL channel, uint8_t pattern );
12513  Summary:
12514  Sets the pattern match ignore value.
12515  Description:
12516  This function sets the value of the pattern match ignore.
12517  Precondition:
12518  None.
12519  Parameters:
12520  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12521  pattern - Pattern match ignore value
12522  Returns:
12523  None.
12524  Example:
12525  <code>
12526  uint8_t patternMatch = 0x8;
12527  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12528  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
12529  </code>
12530  Remarks:
12531  This function implements an operation of the ChannelXPatternIgnore feature.
12532  This feature may not be available on all devices. Please refer to the
12533  specific device data sheet to determine availability or use the
12534  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12535  determine whether this feature is available.
12536 */
12537 
12538 void
12540  DMA_MODULE_ID index ,
12541  DMA_CHANNEL channel ,
12542  uint8_t pattern ) ;
12543 //******************************************************************************
12544 /* Function:
12545  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
12546  DMA_CHANNEL channel );
12547  Summary:
12548  Returns the pattern match ignore value.
12549  Description:
12550  This function returns the value of the pattern match ignore.
12551  Precondition:
12552  None.
12553  Parameters:
12554  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12555  Returns:
12556  - uint8_t - Pattern match ignore value
12557  Example:
12558  <code>
12559  uint8_t patternMatch;
12560  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12561  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12562  </code>
12563  Remarks:
12564  This function implements an operation of the ChannelXPatternIgnore feature.
12565  This feature may not be available on all devices. Please refer to the
12566  specific device data sheet to determine availability or use the
12567  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12568  determine whether this feature is available.
12569 */
12570 
12571 uint8_t
12573  DMA_MODULE_ID index ,
12574  DMA_CHANNEL channel ) ;
12575 // *****************************************************************************
12576 // *****************************************************************************
12577 // Section: DMA Peripheral Library Exists API Routines
12578 // *****************************************************************************
12579 // *****************************************************************************
12580 /* The following functions indicate the existence of the features on the device.
12581 */
12582 //******************************************************************************
12583 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12584  Summary:
12585  Identifies whether the Busy feature exists on the DMA module.
12586  Description:
12587  This function identifies whether the Busy feature is available on the
12588  DMA module.
12589  When this function returns true, these functions are supported on the device:
12590  - PLIB_DMA_BusyActiveSet
12591  - PLIB_DMA_BusyActiveReset
12592  - PLIB_DMA_IsBusy
12593  Preconditions:
12594  None.
12595  Parameters:
12596  index - Identifier for the device instance
12597  Returns:
12598  - true - The Busy feature is supported on the device
12599  - false - The Busy feature is not supported on the device
12600  Remarks:
12601  None.
12602 */
12603 
12604 bool
12606  DMA_MODULE_ID index ) ;
12607 //******************************************************************************
12608 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12609  Summary:
12610  Identifies whether the Suspend feature exists on the DMA module.
12611  Description:
12612  This function identifies whether the Suspend feature is available on the
12613  DMA module.
12614  When this function returns true, these functions are supported on the device:
12615  - PLIB_DMA_SuspendEnable
12616  - PLIB_DMA_SuspendDisable
12617  - PLIB_DMA_SuspendIsEnabled
12618  Preconditions:
12619  None.
12620  Parameters:
12621  index - Identifier for the device instance
12622  Returns:
12623  - true - The Suspend feature is supported on the device
12624  - false - The Suspend feature is not supported on the device
12625  Remarks:
12626  None.
12627 */
12628 
12629 bool
12631  DMA_MODULE_ID index ) ;
12632 //******************************************************************************
12633 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12634  Summary:
12635  Identifies whether the StopInIdle feature exists on the DMA module.
12636  Description:
12637  This function identifies whether the StopInIdle feature is available on the
12638  DMA module.
12639  When this function returns true, these functions are supported on the device:
12640  - PLIB_DMA_StopInIdleEnable
12641  - PLIB_DMA_StopInIdleDisable
12642  Preconditions:
12643  None.
12644  Parameters:
12645  index - Identifier for the device instance
12646  Returns:
12647  - true - The StopInIdle feature is supported on the device
12648  - false - The StopInIdle feature is not supported on the device
12649  Remarks:
12650  None.
12651 */
12652 
12653 bool
12655  DMA_MODULE_ID index ) ;
12656 //******************************************************************************
12657 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12658  Summary:
12659  Identifies whether the EnableControl feature exists on the DMA module.
12660  Description:
12661  This function identifies whether the EnableControl feature is available on
12662  the DMA module.
12663  When this function returns true, these functions are supported on the device:
12664  - PLIB_DMA_Enable
12665  - PLIB_DMA_Disable
12666  - PLIB_DMA_IsEnabled
12667  Preconditions:
12668  None.
12669  Parameters:
12670  index - Identifier for the device instance
12671  Returns:
12672  - true - The EnableControl feature is supported on the device
12673  - false - The EnableControl feature is not supported on the device
12674  Remarks:
12675  None.
12676 */
12677 
12678 bool
12680  DMA_MODULE_ID index ) ;
12681 //******************************************************************************
12682 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12683  Summary:
12684  Identifies whether the ChannelBits feature exists on the DMA module.
12685  Description:
12686  This function identifies whether the ChannelBits feature is available on the
12687  DMA module.
12688  When this function returns true, this function is supported on the device:
12689  - PLIB_DMA_ChannelBitsGet
12690  Preconditions:
12691  None.
12692  Parameters:
12693  index - Identifier for the device instance
12694  Returns:
12695  - true - The ChannelBits feature is supported on the device
12696  - false - The ChannelBits feature is not supported on the device
12697  Remarks:
12698  None.
12699 */
12700 
12701 bool
12703  DMA_MODULE_ID index ) ;
12704 //******************************************************************************
12705 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12706  Summary:
12707  Identifies whether the LastBusAccess feature exists on the DMA module.
12708  Description:
12709  This function identifies whether the LastBusAccess feature is available on the
12710  DMA module.
12711  When this function returns true, these functions are supported on the device:
12712  - PLIB_DMA_LastBusAccessIsRead
12713  - PLIB_DMA_LastBusAccessIsWrite
12714  Preconditions:
12715  None.
12716  Parameters:
12717  index - Identifier for the device instance
12718  Returns:
12719  - true - The LastBusAccess feature is supported on the device
12720  - false - The LastBusAccess feature is not supported on the device
12721  Remarks:
12722  None.
12723 */
12724 
12725 bool
12727  DMA_MODULE_ID index ) ;
12728 //******************************************************************************
12729 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12730  Summary:
12731  Identifies whether the RecentAddress feature exists on the DMA module.
12732  Description:
12733  This function identifies whether the RecentAddress feature is available on
12734  the DMA module.
12735  When this function returns true, this function is supported on the device:
12736  - PLIB_DMA_RecentAddressAccessed
12737  Preconditions:
12738  None.
12739  Parameters:
12740  index - Identifier for the device instance
12741  Returns:
12742  - true - The RecentAddress feature is supported on the device
12743  - false - The RecentAddress feature is not supported on the device
12744  Remarks:
12745  None.
12746 */
12747 
12748 bool
12750  DMA_MODULE_ID index ) ;
12751 //******************************************************************************
12752 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12753  Summary:
12754  Identifies whether the CRCChannel feature exists on the DMA module.
12755  Description:
12756  This function identifies whether the CRCChannel feature is available on the
12757  DMA module.
12758  When this function returns true, these functions are supported on the device:
12759  - PLIB_DMA_CRCChannelSelect
12760  - PLIB_DMA_CRCChannelGet
12761  Preconditions:
12762  None.
12763  Parameters:
12764  index - Identifier for the device instance
12765  Returns:
12766  - true - The CRCChannel feature is supported on the device
12767  - false - The CRCChannel feature is not supported on the device
12768  Remarks:
12769  None.
12770 */
12771 
12772 bool
12774  DMA_MODULE_ID index ) ;
12775 //******************************************************************************
12776 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12777  Summary:
12778  Identifies whether the CRCType feature exists on the DMA module.
12779  Description:
12780  This function identifies whether the CRCType feature is available on the
12781  DMA module.
12782  When this function returns true, these functions are supported on the device:
12783  - PLIB_DMA_CRCTypeGet
12784  - PLIB_DMA_CRCTypeSet
12785  Preconditions:
12786  None.
12787  Parameters:
12788  index - Identifier for the device instance
12789  Returns:
12790  - true - The CRCType feature is supported on the device
12791  - false - The CRCType feature is not supported on the device
12792  Remarks:
12793  None.
12794 */
12795 
12796 bool
12798  DMA_MODULE_ID index ) ;
12799 //******************************************************************************
12800 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12801  Summary:
12802  Identifies whether the CRCAppendMode feature exists on the DMA module.
12803  Description:
12804  This function identifies whether the CRCAppendMode feature is available on
12805  the DMA module.
12806  When this function returns true, these functions are supported on the device:
12807  - PLIB_DMA_CRCAppendModeEnable
12808  - PLIB_DMA_CRCAppendModeDisable
12809  - PLIB_DMA_CRCAppendModeIsEnabled
12810  Preconditions:
12811  None.
12812  Parameters:
12813  index - Identifier for the device instance
12814  Returns:
12815  - true - The CRCAppendMode feature is supported on the device
12816  - false - The CRCAppendMode feature is not supported on the device
12817  Remarks:
12818  None.
12819 */
12820 
12821 bool
12823  DMA_MODULE_ID index ) ;
12824 //******************************************************************************
12825 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12826  Summary:
12827  Identifies whether the CRC feature exists on the DMA module.
12828  Description:
12829  This function identifies whether the CRC feature is available on the DMA module.
12830  When this function returns true, these functions are supported on the device:
12831  - PLIB_DMA_CRCEnable
12832  - PLIB_DMA_CRCDisable
12833  - PLIB_DMA_CRCIsEnabled
12834  Preconditions:
12835  None.
12836  Parameters:
12837  index - Identifier for the device instance
12838  Returns:
12839  - true - The CRC feature is supported on the device
12840  - false - The CRC feature is not supported on the device
12841  Remarks:
12842  None.
12843 */
12844 
12845 bool
12847  DMA_MODULE_ID index ) ;
12848 //******************************************************************************
12849 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12850  Summary:
12851  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12852  Description:
12853  This function identifies whether the CRCPolynomialLength feature is available
12854  on the DMA module.
12855  When this function returns true, these functions are supported on the device:
12856  - PLIB_DMA_CRCPolynomialLengthSet
12857  - PLIB_DMA_CRCPolynomialLengthGet
12858  Preconditions:
12859  None.
12860  Parameters:
12861  index - Identifier for the device instance
12862  Returns:
12863  - true - The CRCPolynomialLength feature is supported on the device
12864  - false - The CRCPolynomialLength feature is not supported on the device
12865  Remarks:
12866  None.
12867 */
12868 
12869 bool
12871  DMA_MODULE_ID index ) ;
12872 //******************************************************************************
12873 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12874  Summary:
12875  Identifies whether the CRCBitOrder feature exists on the DMA module.
12876  Description:
12877  This function identifies whether the CRCBitOrder feature is available on the
12878  DMA module.
12879  When this function returns true, this function is supported on the device:
12880  - PLIB_DMA_CRCBitOrderSelect
12881  Preconditions:
12882  None.
12883  Parameters:
12884  index - Identifier for the device instance
12885  Returns:
12886  - true - The CRCBitOrder feature is supported on the device
12887  - false - The CRCBitOrder feature is not supported on the device
12888  Remarks:
12889  None.
12890 */
12891 
12892 bool
12894  DMA_MODULE_ID index ) ;
12895 //******************************************************************************
12896 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12897  Summary:
12898  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12899  Description:
12900  This function identifies whether the CRCWriteByteOrder feature is available
12901  on the DMA module.
12902  When this function returns true, these functions are supported on the device:
12903  - PLIB_DMA_CRCWriteByteOrderAlter
12904  - PLIB_DMA_CRCWriteByteOrderMaintain
12905  Preconditions:
12906  None.
12907  Parameters:
12908  index - Identifier for the device instance
12909  Returns:
12910  - true - The CRCWriteByteOrder feature is supported on the device
12911  - false - The CRCWriteByteOrder feature is not supported on the device
12912  Remarks:
12913  None.
12914 */
12915 
12916 bool
12918  DMA_MODULE_ID index ) ;
12919 //******************************************************************************
12920 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12921  Summary:
12922  Identifies whether the CRCByteOrder feature exists on the DMA module.
12923  Description:
12924  This function identifies whether the CRCByteOrder feature is available on
12925  the DMA module.
12926  When this function returns true, these functions are supported on the device:
12927  - PLIB_DMA_CRCByteOrderSelect
12928  - PLIB_DMA_CRCByteOrderGet
12929  Preconditions:
12930  None.
12931  Parameters:
12932  index - Identifier for the device instance
12933  Returns:
12934  - true - The CRCByteOrder feature is supported on the device
12935  - false - The CRCByteOrder feature is not supported on the device
12936  Remarks:
12937  None.
12938 */
12939 
12940 bool
12942  DMA_MODULE_ID index ) ;
12943 //******************************************************************************
12944 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12945  Summary:
12946  Identifies whether the CRCData feature exists on the DMA module.
12947  Description:
12948  This function identifies whether the CRCData feature is available on the
12949  DMA module.
12950  When this function returns true, these functions are supported on the device:
12951  - PLIB_DMA_CRCDataRead
12952  - PLIB_DMA_CRCDataWrite
12953  Preconditions:
12954  None.
12955  Parameters:
12956  index - Identifier for the device instance
12957  Returns:
12958  - true - The CRCData feature is supported on the device
12959  - false - The CRCData feature is not supported on the device
12960  Remarks:
12961  None.
12962 */
12963 
12964 bool
12966  DMA_MODULE_ID index ) ;
12967 //******************************************************************************
12968 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12969  Summary:
12970  Identifies whether the CRCXOREnable feature exists on the DMA module.
12971  Description:
12972  This function identifies whether the CRCXOREnable feature is available on the
12973  DMA module.
12974  When this function returns true, these functions are supported on the device:
12975  - PLIB_DMA_CRCXOREnableSet
12976  - PLIB_DMA_CRCXOREnableGet
12977  Preconditions:
12978  None.
12979  Parameters:
12980  index - Identifier for the device instance
12981  Returns:
12982  - true - The CRCXOREnable feature is supported on the device
12983  - false - The CRCXOREnable feature is not supported on the device
12984  Remarks:
12985  None.
12986 */
12987 
12988 bool
12990  DMA_MODULE_ID index ) ;
12991 //******************************************************************************
12992 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12993  Summary:
12994  Identifies whether the ChannelXPriority feature exists on the DMA module.
12995  Description:
12996  This function identifies whether the ChannelXPriority feature is available on
12997  the DMA module.
12998  When this function returns true, these functions are supported on the device:
12999  - PLIB_DMA_ChannelXPrioritySelect
13000  - PLIB_DMA_ChannelXPriorityGet
13001  Preconditions:
13002  None.
13003  Parameters:
13004  index - Identifier for the device instance
13005  Returns:
13006  - true - The ChannelXPriority feature is supported on the device
13007  - false - The ChannelXPriority feature is not supported on the device
13008  Remarks:
13009  None.
13010 */
13011 
13012 bool
13014  DMA_MODULE_ID index ) ;
13015 //******************************************************************************
13016 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
13017  Summary:
13018  Identifies whether the ChannelXEvent feature exists on the DMA module.
13019  Description:
13020  This function identifies whether the ChannelXEvent feature is available on
13021  the DMA module.
13022  When this function returns true, this function is supported on the device:
13023  - PLIB_DMA_ChannelXEventIsDetected
13024  Preconditions:
13025  None.
13026  Parameters:
13027  index - Identifier for the device instance
13028  Returns:
13029  - true - The ChannelXEvent feature is supported on the device
13030  - false - The ChannelXEvent feature is not supported on the device
13031  Remarks:
13032  None.
13033 */
13034 
13035 bool
13037  DMA_MODULE_ID index ) ;
13038 //******************************************************************************
13039 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
13040  Summary:
13041  Identifies whether the ChannelXAuto feature exists on the DMA module.
13042  Description:
13043  This function identifies whether the ChannelXAuto feature is available on
13044  the DMA module.
13045  When this function returns true, these functions are supported on the device:
13046  - PLIB_DMA_ChannelXAutoEnable
13047  - PLIB_DMA_ChannelXAutoDisable
13048  - PLIB_DMA_ChannelXAutoIsEnabled
13049  Preconditions:
13050  None.
13051  Parameters:
13052  index - Identifier for the device instance
13053  Returns:
13054  - true - The ChannelXAuto feature is supported on the device
13055  - false - The ChannelXAuto feature is not supported on the device
13056  Remarks:
13057  None.
13058 */
13059 
13060 bool
13062  DMA_MODULE_ID index ) ;
13063 //******************************************************************************
13064 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
13065  Summary:
13066  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
13067  Description:
13068  This function identifies whether the ChannelXChainEnbl feature is available
13069  on the DMA module.
13070  When this function returns true, these functions are supported on the device:
13071  - PLIB_DMA_ChannelXChainEnable
13072  - PLIB_DMA_ChannelXChainDisable
13073  - PLIB_DMA_ChannelXChainIsEnabled
13074  Preconditions:
13075  None.
13076  Parameters:
13077  index - Identifier for the device instance
13078  Returns:
13079  - true - The ChannelXChainEnbl feature is supported on the device
13080  - false - The ChannelXChainEnbl feature is not supported on the device
13081  Remarks:
13082  None.
13083 */
13084 
13085 bool
13087  DMA_MODULE_ID index ) ;
13088 //******************************************************************************
13089 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
13090  Summary:
13091  Identifies whether the ChannelXDisabled feature exists on the DMA module.
13092  Description:
13093  This function identifies whether the ChannelXDisabled feature is available
13094  on the DMA module.
13095  When this function returns true, these functions are supported on the device:
13096  - PLIB_DMA_ChannelXDisabledEnablesEvents
13097  - PLIB_DMA_ChannelXDisabledDisablesEvents
13098  Preconditions:
13099  None.
13100  Parameters:
13101  index - Identifier for the device instance
13102  Returns:
13103  - true - The ChannelXDisabled feature is supported on the device
13104  - false - The ChannelXDisabled feature is not supported on the device
13105  Remarks:
13106  None.
13107 */
13108 
13109 bool
13111  DMA_MODULE_ID index ) ;
13112 //******************************************************************************
13113 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
13114  Summary:
13115  Identifies whether the ChannelX feature exists on the DMA module.
13116  Description:
13117  This function identifies whether the ChannelX feature is available on the
13118  DMA module.
13119  When this function returns true, these functions are supported on the device:
13120  - PLIB_DMA_ChannelXEnable
13121  - PLIB_DMA_ChannelXIsEnabled
13122  - PLIB_DMA_ChannelXDisable
13123  Preconditions:
13124  None.
13125  Parameters:
13126  index - Identifier for the device instance
13127  Returns:
13128  - true - The ChannelX feature is supported on the device
13129  - false - The ChannelX feature is not supported on the device
13130  Remarks:
13131  None.
13132 */
13133 
13134 bool
13136  DMA_MODULE_ID index ) ;
13137 //******************************************************************************
13138 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
13139  Summary:
13140  Identifies whether the ChannelXChain feature exists on the DMA module.
13141  Description:
13142  This function identifies whether the ChannelXChain feature is available on the
13143  DMA module.
13144  When this function returns true, these functions are supported on the device:
13145  - PLIB_DMA_ChannelXChainToLower
13146  - PLIB_DMA_ChannelXChainToHigher
13147  Preconditions:
13148  None.
13149  Parameters:
13150  index - Identifier for the device instance
13151  Returns:
13152  - true - The ChannelXChain feature is supported on the device
13153  - false - The ChannelXChain feature is not supported on the device
13154  Remarks:
13155  None.
13156 */
13157 
13158 bool
13160  DMA_MODULE_ID index ) ;
13161 //******************************************************************************
13162 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
13163  Summary:
13164  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
13165  Description:
13166  This function identifies whether the ChannelXPatternLength feature is available
13167  on the DMA module.
13168  When this function returns true, these functions are supported on the device:
13169  - PLIB_DMA_ChannelXPatternLengthSet
13170  - PLIB_DMA_ChannelXPatternLengthGet
13171  Preconditions:
13172  None.
13173  Parameters:
13174  index - Identifier for the device instance
13175  Returns:
13176  - true - The ChannelXPatternLength feature is supported on the device
13177  - false - The ChannelXPatternLength feature is not supported on the device
13178  Remarks:
13179  None.
13180 */
13181 
13182 bool
13184  DMA_MODULE_ID index ) ;
13185 //******************************************************************************
13186 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
13187  Summary:
13188  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
13189  module.
13190  Description:
13191  This function identifies whether the ChannelXPatternIgnoreByte feature is
13192  available on the DMA module.
13193  When this function returns true, these functions are supported on the device:
13194  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
13195  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
13196  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
13197  Preconditions:
13198  None.
13199  Parameters:
13200  index - Identifier for the device instance
13201  Returns:
13202  - true - The ChannelXPatternIgnoreByte feature is supported on the device
13203  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
13204  Remarks:
13205  None.
13206 */
13207 
13208 bool
13210  DMA_MODULE_ID index ) ;
13211 //******************************************************************************
13212 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
13213  Summary:
13214  Identifies whether the ChannelXBusy feature exists on the DMA module.
13215  Description:
13216  This function identifies whether the ChannelXBusy feature is available on the
13217  DMA module.
13218  When this function returns true, these functions are supported on the device:
13219  - PLIB_DMA_ChannelXBusyActiveSet
13220  - PLIB_DMA_ChannelXBusyInActiveSet
13221  - PLIB_DMA_ChannelXBusyIsBusy
13222  Preconditions:
13223  None.
13224  Parameters:
13225  index - Identifier for the device instance
13226  Returns:
13227  - true - The ChannelXBusy feature is supported on the device
13228  - false - The ChannelXBusy feature is not supported on the device
13229  Remarks:
13230  None.
13231 */
13232 
13233 bool
13235  DMA_MODULE_ID index ) ;
13236 //******************************************************************************
13237 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
13238  Summary:
13239  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
13240  Description:
13241  This function identifies whether the ChannelXPatternIgnore feature is available
13242  on the DMA module.
13243  When this function returns true, these functions are supported on the device:
13244  - PLIB_DMA_ChannelXPatternIgnoreSet
13245  - PLIB_DMA_ChannelXPatternIgnoreGet
13246  Preconditions:
13247  None.
13248  Parameters:
13249  index - Identifier for the device instance
13250  Returns:
13251  - true - The ChannelXPatternIgnore feature is supported on the device
13252  - false - The ChannelXPatternIgnore feature is not supported on the device
13253  Remarks:
13254  None.
13255 */
13256 
13257 bool
13259  DMA_MODULE_ID index ) ;
13260 //******************************************************************************
13261 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
13262  Summary:
13263  Identifies whether the ChannelXTrigger feature exists on the DMA module.
13264  Description:
13265  This function identifies whether the ChannelXTrigger feature is available on
13266  the DMA module.
13267  When this function returns true, these functions are supported on the device:
13268  - PLIB_DMA_ChannelXTriggerEnable
13269  - PLIB_DMA_ChannelXTriggerIsEnabled
13270  - PLIB_DMA_ChannelXTriggerDisable
13271  Preconditions:
13272  None.
13273  Parameters:
13274  index - Identifier for the device instance
13275  Returns:
13276  - true - The ChannelXTrigger feature is supported on the device
13277  - false - The ChannelXTrigger feature is not supported on the device
13278  Remarks:
13279  None.
13280 */
13281 
13282 bool
13284  DMA_MODULE_ID index ) ;
13285 //******************************************************************************
13286 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
13287  Summary:
13288  Identifies whether the AbortTransfer feature exists on the DMA module.
13289  Description:
13290  This function identifies whether the AbortTransfer feature is available on
13291  the DMA module.
13292  When this function returns true, this function is supported on the device:
13293  - PLIB_DMA_AbortTransferSet
13294  Preconditions:
13295  None.
13296  Parameters:
13297  index - Identifier for the device instance
13298  Returns:
13299  - true - The AbortTransfer feature is supported on the device
13300  - false - The AbortTransfer feature is not supported on the device
13301  Remarks:
13302  None.
13303 */
13304 
13305 bool
13307  DMA_MODULE_ID index ) ;
13308 //******************************************************************************
13309 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
13310  Summary:
13311  Identifies whether the StartTransfer feature exists on the DMA module.
13312  Description:
13313  This function identifies whether the StartTransfer feature is available on
13314  the DMA module.
13315  When this function returns true, this function is supported on the device:
13316  - PLIB_DMA_StartTransferSet
13317  Preconditions:
13318  None.
13319  Parameters:
13320  index - Identifier for the device instance
13321  Returns:
13322  - true - The StartTransfer feature is supported on the device
13323  - false - The StartTransfer feature is not supported on the device
13324  Remarks:
13325  None.
13326 */
13327 
13328 bool
13330  DMA_MODULE_ID index ) ;
13331 //******************************************************************************
13332 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
13333  Summary:
13334  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
13335  Description:
13336  This function identifies whether the ChannelXStartIRQ feature is available
13337  on the DMA module.
13338  When this function returns true, this function is supported on the device:
13339  - PLIB_DMA_ChannelXStartIRQSet
13340  Preconditions:
13341  None.
13342  Parameters:
13343  index - Identifier for the device instance
13344  Returns:
13345  - true - The ChannelXStartIRQ feature is supported on the device
13346  - false - The ChannelXStartIRQ feature is not supported on the device
13347  Remarks:
13348  None.
13349 */
13350 
13351 bool
13353  DMA_MODULE_ID index ) ;
13354 //******************************************************************************
13355 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
13356  Summary:
13357  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
13358  Description:
13359  This function identifies whether the ChannelXAbortIRQ feature is available
13360  on the DMA module.
13361  When this function returns true, this function is supported on the device:
13362  - PLIB_DMA_ChannelXAbortIRQSet
13363  Preconditions:
13364  None.
13365  Parameters:
13366  index - Identifier for the device instance
13367  Returns:
13368  - true - The ChannelXAbortIRQ feature is supported on the device
13369  - false - The ChannelXAbortIRQ feature is not supported on the device
13370  Remarks:
13371  None.
13372 */
13373 
13374 bool
13376  DMA_MODULE_ID index ) ;
13377 //******************************************************************************
13378 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
13379  Summary:
13380  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
13381  Description:
13382  This function identifies whether the ChannelXINTSourceFlag feature is available
13383  on the DMA module.
13384  When this function returns true, these functions are supported on the device:
13385  - PLIB_DMA_ChannelXINTSourceFlagGet
13386  - PLIB_DMA_ChannelXINTSourceFlagSet
13387  - PLIB_DMA_ChannelXINTSourceFlagClear
13388  Preconditions:
13389  None.
13390  Parameters:
13391  index - Identifier for the device instance
13392  Returns:
13393  - true - The ChannelXINTSourceFlag feature is supported on the device
13394  - false - The ChannelXINTSourceFlag feature is not supported on the device
13395  Remarks:
13396  None.
13397 */
13398 
13399 bool
13401  DMA_MODULE_ID index ) ;
13402 //******************************************************************************
13403 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
13404  Summary:
13405  Identifies whether the ChannelXINTSource feature exists on the DMA module.
13406  Description:
13407  This function identifies whether the ChannelXINTSource feature is available
13408  on the DMA module.
13409  When this function returns true, these functions are supported on the device:
13410  - PLIB_DMA_ChannelXINTSourceEnable
13411  - PLIB_DMA_ChannelXINTSourceDisable
13412  - PLIB_DMA_ChannelXINTSourceIsEnabled
13413  Preconditions:
13414  None.
13415  Parameters:
13416  index - Identifier for the device instance
13417  Returns:
13418  - true - The ChannelXINTSource feature is supported on the device
13419  - false - The ChannelXINTSource feature is not supported on the device
13420  Remarks:
13421  None.
13422 */
13423 
13424 bool
13426  DMA_MODULE_ID index ) ;
13427 //******************************************************************************
13428 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
13429  Summary:
13430  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
13431  Description:
13432  This function identifies whether the ChannelXSourceStartAddress feature is available
13433  on the DMA module.
13434  When this function returns true, these functions are supported on the device:
13435  - PLIB_DMA_ChannelXSourceStartAddressGet
13436  - PLIB_DMA_ChannelXSourceStartAddressSet
13437  Preconditions:
13438  None.
13439  Parameters:
13440  index - Identifier for the device instance
13441  Returns:
13442  - true - The ChannelXSourceStartAddress feature is supported on the device
13443  - false - The ChannelXSourceStartAddress feature is not supported on the device
13444  Remarks:
13445  None.
13446 */
13447 
13448 bool
13450  DMA_MODULE_ID index ) ;
13451 //******************************************************************************
13452 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
13453  Summary:
13454  Identifies whether the ChannelXDestinationStartAddress feature exists on
13455  the DMA module.
13456  Description:
13457  This function identifies whether the ChannelXDestinationStartAddress feature
13458  is available on the DMA module.
13459  When this function returns true, these functions are supported on the device:
13460  - PLIB_DMA_ChannelXDestinationStartAddressGet
13461  - PLIB_DMA_ChannelXDestinationStartAddressSet
13462  Preconditions:
13463  None.
13464  Parameters:
13465  index - Identifier for the device instance
13466  Returns:
13467  - true - The ChannelXDestinationStartAddress feature is supported on the device
13468  - false - The ChannelXDestinationStartAddress feature is not supported on the device
13469  Remarks:
13470  None.
13471 */
13472 
13473 bool
13475  DMA_MODULE_ID index ) ;
13476 //******************************************************************************
13477 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
13478  Summary:
13479  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
13480  Description:
13481  This function identifies whether the ChannelXSourceSize feature is available
13482  on the DMA module.
13483  When this function returns true, these functions are supported on the device:
13484  - PLIB_DMA_ChannelXSourceSizeGet
13485  - PLIB_DMA_ChannelXSourceSizeSet
13486  Preconditions:
13487  None.
13488  Parameters:
13489  index - Identifier for the device instance
13490  Returns:
13491  - true - The ChannelXSourceSize feature is supported on the device
13492  - false - The ChannelXSourceSize feature is not supported on the device
13493  Remarks:
13494  None.
13495 */
13496 
13497 bool
13499  DMA_MODULE_ID index ) ;
13500 //******************************************************************************
13501 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
13502  Summary:
13503  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
13504  Description:
13505  This function identifies whether the ChannelXDestinationSize feature is available
13506  on the DMA module.
13507  When this function returns true, these functions are supported on the device:
13508  - PLIB_DMA_ChannelXDestinationSizeGet
13509  - PLIB_DMA_ChannelXDestinationSizeSet
13510  Preconditions:
13511  None.
13512  Parameters:
13513  index - Identifier for the device instance
13514  Returns:
13515  - true - The ChannelXDestinationSize feature is supported on the device
13516  - false - The ChannelXDestinationSize feature is not supported on the device
13517  Remarks:
13518  None.
13519 */
13520 
13521 bool
13523  DMA_MODULE_ID index ) ;
13524 //******************************************************************************
13525 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
13526  Summary:
13527  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
13528  Description:
13529  This function identifies whether the ChannelXSourcePointer feature is available
13530  on the DMA module.
13531  When this function returns true, this function is supported on the device:
13532  - PLIB_DMA_ChannelXSourcePointerGet
13533  Preconditions:
13534  None.
13535  Parameters:
13536  index - Identifier for the device instance
13537  Returns:
13538  - true - The ChannelXSourcePointer feature is supported on the device
13539  - false - The ChannelXSourcePointer feature is not supported on the device
13540  Remarks:
13541  None.
13542 */
13543 
13544 bool
13546  DMA_MODULE_ID index ) ;
13547 //******************************************************************************
13548 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13549  Summary:
13550  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13551  Description:
13552  This function identifies whether the ChannelXDestinationPointer feature is available
13553  on the DMA module.
13554  When this function returns true, this function is supported on the device:
13555  - PLIB_DMA_ChannelXDestinationPointerGet
13556  Preconditions:
13557  None.
13558  Parameters:
13559  index - Identifier for the device instance
13560  Returns:
13561  - true - The ChannelXDestinationPointer feature is supported on the device
13562  - false - The ChannelXDestinationPointer feature is not supported on the device
13563  Remarks:
13564  None.
13565 */
13566 
13567 bool
13569  DMA_MODULE_ID index ) ;
13570 //******************************************************************************
13571 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13572  Summary:
13573  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13574  Description:
13575  This function identifies whether the ChannelXCellSize feature is available on
13576  the DMA module.
13577  When this function returns true, these functions are supported on the device:
13578  - PLIB_DMA_ChannelXCellSizeGet
13579  - PLIB_DMA_ChannelXCellSizeSet
13580  Preconditions:
13581  None.
13582  Parameters:
13583  index - Identifier for the device instance
13584  Returns:
13585  - true - The ChannelXCellSize feature is supported on the device
13586  - false - The ChannelXCellSize feature is not supported on the device
13587  Remarks:
13588  None.
13589 */
13590 
13591 bool
13593  DMA_MODULE_ID index ) ;
13594 //******************************************************************************
13595 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13596  Summary:
13597  Identifies whether the ChannelXCellProgressPointer feature exists on the
13598  DMA module.
13599  Description:
13600  This function identifies whether the ChannelXCellProgressPointer feature is
13601  available on the DMA module.
13602  When this function returns true, this function is supported on the device:
13603  - PLIB_DMA_ChannelXCellProgressPointerGet
13604  Preconditions:
13605  None.
13606  Parameters:
13607  index - Identifier for the device instance
13608  Returns:
13609  - true - The ChannelXCellProgressPointer feature is supported on the device
13610  - false - The ChannelXCellProgressPointer feature is not supported on the device
13611  Remarks:
13612  None.
13613 */
13614 
13615 bool
13617  DMA_MODULE_ID index ) ;
13618 //******************************************************************************
13619 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13620  Summary:
13621  Identifies whether the ChannelXPatternData feature exists on the DMA module
13622  Description:
13623  This function identifies whether the ChannelXPatternData feature is available
13624  on the DMA module.
13625  When this function returns true, these functions are supported on the device:
13626  - PLIB_DMA_ChannelXPatternDataGet
13627  - PLIB_DMA_ChannelXPatternDataSet
13628  Preconditions:
13629  None.
13630  Parameters:
13631  index - Identifier for the device instance
13632  Returns:
13633  - true - The ChannelXPatternData feature is supported on the device
13634  - false - The ChannelXPatternData feature is not supported on the device
13635  Remarks:
13636  None.
13637 */
13638 
13639 bool
13641  DMA_MODULE_ID index ) ;
13642 //DOM-IGNORE-BEGIN
13643 //DOM-IGNORE-END
13644  // #ifndef _PLIB_DMA_H
13645 /*******************************************************************************
13646  End of File
13647 */
13648 
13649 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13650 /* CLOSE_FILE Include File */
13651 
13652 // *****************************************************************************
13653 // *****************************************************************************
13654 // Section: Data Types
13655 // *****************************************************************************
13656 // *****************************************************************************
13657 // *****************************************************************************
13658 /* DMA System Service Channel None
13659  Summary:
13660  DMA channel none
13661  Description:
13662  This constant identifies the specification of no choice from client
13663  for allocating a particular DMA channel.
13664  Remarks:
13665  This constant should be used in place of hard-coded numeric literals.
13666 */
13667 //DOM-IGNORE-BEGIN
13668 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13669 //DOM-IGNORE-END
13670 // *****************************************************************************
13671 /* DMA System Service Channel Any
13672  Summary:
13673  Identifies the client specification to allocate any available DMA channel.
13674  Description:
13675  This constant identifies the specification by the client
13676  to allocate any available DMA channel.
13677  Remarks:
13678  This constant should be used in place of hard-coded numeric literals.
13679 */
13680 //DOM-IGNORE-BEGIN
13681 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13682 //DOM-IGNORE-END
13683 // *****************************************************************************
13684 /* DMA System Service Channel Count
13685  Summary:
13686  Identifies the maximum number of DMA channel handles to be defined.
13687  Description:
13688  This constant identifies the maximum number of DMA channel handles
13689  that should be defined.
13690  Remarks:
13691  This value is derived from device-specific header files defined as
13692  part of the peripheral libraries.
13693 */
13694 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13695 // *****************************************************************************
13696 /* DMA System Service Channel Handle
13697  Summary:
13698  Assigns the handle for requested channel.
13699  Description:
13700  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13701  function. This handle is associated with the channel number that is used for
13702  data transfer and it allows the application to track the data transfer.
13703  The channel handle once assigned to a client expires when the
13704  client calls SYS_DMA_ChannelRelease.
13705  exits.
13706  Remarks:
13707  None.
13708 */
13709 
13710 typedef
13711 uintptr_t
13713 // *****************************************************************************
13714 /* DMA System Service Invalid Channel Handle
13715  Summary:
13716  Defines an invalid channel handle.
13717  Description:
13718  This is the definition of an invalid channel handle. An invalid buffer handle
13719  is returned by SYS_DMA_ChannelAllocate function if the channel number
13720  request was not successful.
13721  Remarks:
13722  None.
13723 */
13724 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13725 // *****************************************************************************
13726 /* DMA stop in idle mode
13727  Summary:
13728  Enable/Disable DMA operations in Idle mode.
13729  Description:
13730  This data type allows enabling/disabling of DMA operations in idle mode.
13731  Remarks:
13732  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13733  while initializing the DMA module by calling SYS_DMA_Initialize.
13734  This feature may not be available on all devices. Refer to the specific device
13735  data sheet to determine availability.
13736 */
13737 
13738 typedef
13739  enum
13740  {
13741  /* When the CPU enters idle mode, the DMA module continue operations */
13743  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13745  } SYS_DMA_SIDL ;
13746 // *****************************************************************************
13747 /* DMA Channel chaining priority
13748  Summary:
13749  Identifies the priority of chaining channel.
13750  Description:
13751  This data type identifies the priority of chaining channel.
13752  Channel chaining priority identifies the channel that will be enabled
13753  on completion of block data transfer on the master channel.
13754  Remarks:
13755  None.
13756 */
13757 
13758 typedef
13759  enum
13760  {
13761  /* Chain to channel higher in natural priority */
13763  /* Chain to channel lower in natural priority */
13766 // *****************************************************************************
13767 /* DMA Channel ignore pattern match
13768  Summary:
13769  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13770  pattern.
13771  Description:
13772  This data type allows enabling/disabling the feature to ignore a byte
13773  between a 2-byte match abort pattern.
13774  Remarks:
13775  This feature may not be available on all devices. Refer to the specific device
13776  data sheet to determine availability.
13777 */
13778 
13779 typedef
13780  enum
13781  {
13782  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13784  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13787 // *****************************************************************************
13788 /* DMA channel CRC mode
13789  Summary:
13790  Identifies the operation mode of the CRC module.
13791  Description:
13792  This data type identifies CRC operating mode. The CRC computation can be
13793  in background mode or append mode.
13794  Remarks:
13795  None.
13796 */
13797 
13798 typedef
13799  enum
13800  {
13801  /* DMA reads the data from the source, passes it through the CRC module and
13802  writes it to the destination. the calculated CRC is left in the DCRCDATA
13803  register at the end of the block transfer. */
13805  /* DMA only feeds source data to the CRC module. it does not write source data
13806  to the destination address. When a block transfer complete or pattern abort
13807  event occur, The DMA writes the CRC value to the destination address */
13810 // *****************************************************************************
13811 /* DMA channel CRC write order
13812  Summary:
13813  Identifies altering/maintaining write order post CRC computation.
13814  Description:
13815  This data type identifies write byte order selection post CRC
13816  computation.
13817  Remarks:
13818  None.
13819 */
13820 
13821 typedef
13822  enum
13823  {
13824  /* Source data is written to the destination unchanged regardless
13825  of the selected pre-CRC byte order. */
13827  /* Source data is written to the destination reordered according
13828  to the selected pre-CRC byte order. */
13831 // *****************************************************************************
13832 /* DMA channel operation modes
13833  Summary:
13834  Identifies the available DMA operating modes.
13835  Description:
13836  This data type Identifies the available DMA operating modes.
13837  The supported DMA modes are not mutually exclusive, but can be simultaneously
13838  operational.
13839  Remarks:
13840  These supported DMA modes can be logically OR'd together. They are passed
13841  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13842 */
13843 
13844 typedef
13845  enum
13846  {
13847  /* The normal DMA operation mode. The DMA channel will transfer data from
13848  a source to a destination without CPU intervention */
13849  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13850  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13851  ,
13852  /* Pattern Match abort mode allows the user to end a transfer if data
13853  written during a transaction matches a specific pattern, as defined by
13854  the DCHxDAT register */
13856  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13857  ,
13858  /* Channel chaining operating mode enhances the normal DMA channel
13859  operations. A channel(slave) can be chained to an adjacent channel(master).
13860  The slave channel will be enabled when a block transfer of the master
13861  channel completes. */
13862  /* only one of the below two chaining priorities must be provided.
13863  Chaining priority High. */
13865  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13866  ,
13867  /* Chaining priority Low */
13869  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13870  ,
13871  /* Auto enable operating mode allows a channel to be kept active, even if a
13872  block transfer completes or pattern match occurs. This prevents the user
13873  from having to re-enable the channel each time a block transfer completes. */
13874  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13875  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13876  ,
13877  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13878  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13879  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13881 // *****************************************************************************
13882 /* DMA channel CRC mode
13883  Summary:
13884  Defines the attributes for CRC operation mode.
13885  Description:
13886  This data type defines the attributes for CRC operation mode.
13887  Remarks:
13888  This feature may not be available on all devices. Refer to the specific device
13889  data sheet to determine availability.
13890 */
13891 
13892 typedef
13893  struct
13894  {
13895  /* CRC type (PLIB-level).
13896  Type Selection identifies whether the CRC module will calculate an IP
13897  header checksum or an LFSR CRC */
13898  DMA_CRC_TYPE type ;
13899  /* CRC mode, Background or Append */
13901  /* Polynomial length, This value is redundant when the selected CRC type is
13902  IP header checksum. When the CRC type is LFSR, Identifies the length of
13903  the polynomial. */
13904  uint8_t polyLength ;
13905  /* Bit order (PLIB-level).
13906  Identifies whether the CRC is computed LSb or MSb first */
13907  DMA_CRC_BIT_ORDER bitOrder ;
13908  /* Byte order (PLIB-level).
13909  Identifies the byte selection order input pre-CRC Generator. */
13910  DMA_CRC_BYTE_ORDER byteOrder ;
13911  /* Post CRC Write order */
13912  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13913  /* CRC data feed: While enabling the CRC mode, this field gives
13914  the seed for the CRC computation. On block transfer complete or
13915  pattern match abort the field have the computed CRC. */
13916  uint32_t data ;
13917  /* XOR bit mask, This value is redundant when the selected CRC type is
13918  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13919  bit mask input to the shift register during CRC computation. */
13920  uint32_t xorBitMask ;
13922 // *****************************************************************************
13923 /* DMA System service Events
13924  Summary:
13925  Enumeration of possible DMA System service events.
13926  Description:
13927  This data type provides an enumeration of all possible DMA System service events.
13928  Remarks:
13929  None.
13930 */
13931 
13932 typedef
13933  enum
13934  {
13935  /* Data was transferred successfully. */
13937  /* Error while processing the request */
13939  /* Data transfer was aborted. */
13941  /* No events yet. */
13944 // *****************************************************************************
13945 /* DMA System service Error
13946  Summary:
13947  Indicates the error information for the DMA System service.
13948  Description:
13949  This enumeration indicates the error information for the DMA System service.
13950  Remarks:
13951  None.
13952 */
13953 
13954 typedef
13955  enum
13956  {
13957  /* Data was transferred successfully. */
13958  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13959  = 1 << 0 ,
13960  /* DOM-IGNORE-END*/
13961  /* DMA address error. */
13962  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13963  = 1 << 1 /* DOM-IGNORE-END*/
13964  } SYS_DMA_ERROR ;
13965 // *****************************************************************************
13966 /* DMA Initialization data
13967  Summary:
13968  Defines the data required to initialize the DMA subsystem.
13969  Description:
13970  This data type defines the data required to initialize the DMA subsystem.
13971  Remarks:
13972  This feature may not be available on all devices. Refer to the specific device
13973  data sheet to determine availability.
13974 */
13975 
13976 typedef
13977  struct
13978  {
13979  /* Enable/Disable stop in idle mode feature */
13980  SYS_DMA_SIDL sidl ;
13981  } SYS_DMA_INIT ;
13982 // *****************************************************************************
13983 /* Data width options */
13984 
13985 typedef
13986  enum
13987  {
13988  /* Data width configuration feature is not available */
13990  } SYS_DMA_DATA_WIDTH ;
13991 // *****************************************************************************
13992 /* DMA descriptor control
13993  Summary:
13994  Defines the descriptor control for linked list operation.
13995  Description:
13996  This data type defines the descriptor control for linked list operation.
13997  Remarks:
13998  This feature may not be available on all devices. Refer to the specific device
13999  data sheet to determine availability.
14000 */
14001 
14002 typedef
14003  union
14004  {
14005  /* Feature is not supported */
14006  ;
14008 // *****************************************************************************
14009 // *****************************************************************************
14010 // Section: Initialization and Task Functions
14011 // *****************************************************************************
14012 // *****************************************************************************
14013 //******************************************************************************
14014 /* Function:
14015  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14016  Summary:
14017  Maintains the system service's state machine.
14018 
14019  Description:
14020  This function is used to maintain the DMA system service's internal state
14021  machine. This function services events on a specific DMA channel.
14022  Precondition:
14023  DMA should have been initialized by calling SYS_DMA_Initialize.
14024  Parameters:
14025  object - Object handle for the DMA module (returned from
14026  SYS_DMA_Initialize)
14027  activeChannel - DMA channel number to be serviced.
14028  Returns:
14029  None.
14030  Example:
14031  <code>
14032  // 'object' Returned from SYS_DMA_Initialize
14033  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
14034  {
14035  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
14036  }
14037  </code>
14038  Remarks:
14039  This function is normally not called directly by an application. It is
14040  called by the system's task/interrupt routines.
14041  */
14042 
14043 void
14044  SYS_DMA_Tasks (
14045  SYS_MODULE_OBJ object ,
14046  DMA_CHANNEL activeChannel ) ;
14047 //******************************************************************************
14048 /* For backward compatibility */
14049 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
14050  // #ifndef _SYS_DMA_DEFINITIONS_H
14051 /*******************************************************************************
14052  End of File
14053 */
14054 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
14055 /* CLOSE_FILE Include File */
14056 
14057 // DOM-IGNORE-BEGIN
14058 // DOM-IGNORE-END
14059 // *****************************************************************************
14060 // *****************************************************************************
14061 // Section: DMA System Service Interface Routines
14062 // *****************************************************************************
14063 // *****************************************************************************
14064 // *****************************************************************************
14065 /* DMA System service Transfer Event Handler Function
14066  Summary:
14067  Pointer to a DMA System service Transfer Event handler function.
14068  Description:
14069  This data type defines a DMA System service Transfer Event Handler Function.
14070  A DMA system service client must register an transfer event handler function of
14071  this type to receive transfer related events from the system service.
14072  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
14073  was transferred successfully. The channelHandle parameter contains the channel
14074  handle of the channel on which the transfer was processed.
14075  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
14076  not transferred successfully. TThe channelHandle parameter contains the channel
14077  handle of the channel on which the transfer had failed.
14078  The contextHandle parameter contains the context handle that was provided by
14079  the client at the time of registering the event handler. This context handle
14080  can be anything that the client consider helpful or necessary to identify
14081  the client context object associated with the channel of the system
14082  service that generated the event.
14083  The event handler function executes in an interrupt context when DMA is setup
14084  to start operation by an interrupt trigger source. It is recommended of the
14085  application to not perform process intensive operations with in this
14086  function.
14087  Remarks:
14088  None.
14089 */
14090 
14091 typedef
14093 SYS_DMA_CHANNEL_HANDLE handle ,
14094 uintptr_t contextHandle ) ;
14095 // *****************************************************************************
14096 // *****************************************************************************
14097 // Section: Initialization and Task Functions
14098 // *****************************************************************************
14099 // *****************************************************************************
14100 //******************************************************************************
14101 /* Function:
14102  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
14103  Summary:
14104  Initializes and Enables the DMA Controller.
14105  Description:
14106  This function Enables the DMA module. Enable/Disable stop in idle mode
14107  feature based on the passed parameter value.
14108  This function initializes the DMA module making it ready for clients to
14109  open and use it. The initialization data is specified by the init parameter.
14110  Precondition:
14111  None.
14112  Parameters:
14113  init - Pointer to the data structure containing any data
14114  necessary to initialize the hardware. This pointer may
14115  be null if no data is required and default
14116  initialization is to be used.
14117  Returns:
14118  If successful, returns a valid handle to the DMA module object.
14119  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
14120  Example:
14121  <code>
14122  SYS_MODULE_OBJ objectHandle;
14123  SYS_DMA_INIT initParam;
14124  initParam.sidl = SYS_DMA_SIDL_ENABLE;
14125  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
14126  (SYS_MODULE_INIT*)initParam);
14127  if (SYS_MODULE_OBJ_INVALID == objectHandle)
14128  {
14129  // Handle error
14130  }
14131  </code>
14132  Remarks:
14133  This function must be called before any other DMA systems service routines
14134  are called.
14135  Not all features are available on all micro-controllers.
14136 */
14137 
14138 SYS_MODULE_OBJ
14140  const SYS_MODULE_INIT * const init ) ;
14141 // *****************************************************************************
14142 // *****************************************************************************
14143 // Section: Channel Setup and management functions
14144 // *****************************************************************************
14145 // *****************************************************************************
14146 //******************************************************************************
14147 /* Function:
14148  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
14149  Summary:
14150  Allocates the specified DMA channel and returns a handle to it.
14151  Description:
14152  This function opens the specified DMA channel and provides a
14153  handle that must be provided to all other client-level operations to
14154  identify the caller and the DMA channel.
14155  Precondition:
14156  Function SYS_DMA_Initialize must have been called before calling this
14157  function.
14158  Parameters:
14159  channel - Channel number requested for allocation.
14160  When channel number specified is DMA_CHANNEL_ANY
14161  a random channel is allocated for DMA transfers.
14162  Returns:
14163  The channel handle for the requested channel number.
14164  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
14165  Error can occur.
14166  - if the requested channel number is invalid.
14167  - if the requested channel number is not free.
14168  Example:
14169  <code>
14170  DMA_CHANNEL channel;
14171  SYS_DMA_CHANNEL_HANDLE handle
14172  channel = DMA_CHANNEL_2;
14173  handle = SYS_DMA_ChannelAllocate(channel);
14174  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14175  {
14176  // Failed to allocate the channel
14177  }
14178  else
14179  {
14180  // Proceed with setting up the channel and adding the transfer
14181  }
14182  </code>
14183  Remarks:
14184  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
14185  This function must be called before any other DMA channel Setup and management
14186  routines are called
14187 */
14188 
14191  DMA_CHANNEL channel ) ;
14192 //******************************************************************************
14193 /* Function:
14194  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
14195  Summary:
14196  Deallocates and frees the channel specified by the handle.
14197  Description:
14198  This function deallocates an allocated-channel of the DMA module,
14199  invalidating the handle.
14200  Precondition:
14201  DMA should have been initialized by calling SYS_DMA_Initialize.
14202  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
14203  Parameters:
14204  handle - A valid allocated-channel handle, returned from the service's
14205  Allocate routine
14206  Returns:
14207  None.
14208  Example:
14209  <code>
14210  DMA_CHANNEL channel;
14211  SYS_DMA_CHANNEL_HANDLE handle;
14212  channel = DMA_CHANNEL_2;
14213  handle = SYS_DMA_ChannelAllocate(channel);
14214  SYS_DMA_ChannelRelease(handle);
14215  </code>
14216  Remarks:
14217  After calling this routine, the handle passed in "handle" must not be used
14218  with any of the remaining service's routines. A new handle must be obtained by
14219  calling SYS_DMA_ChannelAllocate before the caller may use the service again
14220 */
14221 
14222 void
14224  SYS_DMA_CHANNEL_HANDLE handle ) ;
14225 //******************************************************************************
14226 /* Function:
14227  void SYS_DMA_ChannelSetup
14228  (
14229  SYS_DMA_CHANNEL_HANDLE handle,
14230  SYS_DMA_CHANNEL_OP_MODE modeEnable
14231  DMA_TRIGGER_SOURCE eventSrc
14232  )
14233  Summary:
14234  Setup the DMA channel parameters.
14235  Description:
14236  This function sets up the DMA channel parameters.
14237  It sets the channel priority and enables the mode of operations for the
14238  current system design.
14239  Precondition:
14240  DMA should have been initialized by calling SYS_DMA_Initialize.
14241  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14242  Parameters:
14243  handle - Handle of the DMA channel as returned by the
14244  SYS_DMA_ChannelAllocate function.
14245  priority - The priority to be associated to the channel.
14246  modeEnable - The supported operating modes to be enabled.
14247  This parameter can be logically ORed to specify
14248  multiple options.
14249  eventSrc - The event causing the cell transfer start.
14250  Returns:
14251  None.
14252  Example:
14253  <code>
14254  // 'handle' is a valid handle returned
14255  // by the SYS_DMA_ChannelAllocate function.
14256  SYS_DMA_CHANNEL_OP_MODE modeEnable;
14257  DMA_TRIGGER_SOURCE eventSrc;
14258  channel = DMA_CHANNEL_2;
14259  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
14260  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
14261  // Setup channel number, and enables basic and CRC mode
14262  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
14263  </code>
14264  Remarks:
14265  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
14266  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
14267  mode setup API's needs to be called to set the related parameters.
14268  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
14269  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
14270  Not all features are available on all microcontrollers.
14271  */
14272 
14273 void
14275  SYS_DMA_CHANNEL_HANDLE handle ,
14276  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
14277  DMA_TRIGGER_SOURCE eventSrc ) ;
14278 //******************************************************************************
14279 /* Function:
14280  void SYS_DMA_ChannelSetupMatchAbortMode
14281  (
14282  SYS_DMA_CHANNEL_HANDLE handle,
14283  uint16_t pattern,
14284  DMA_PATTERN_LENGTH length,
14285  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
14286  uint8_t ignorePattern
14287  )
14288  Summary:
14289  Setup the pattern match abort mode.
14290  Description:
14291  This function sets up the termination of DMA operation when the specified
14292  pattern is matched. Additionally on supported parts the function also
14293  sets up the ignoring of part of a pattern(8-bit) from match abort
14294  pattern(16-bit).
14295  Precondition:
14296  DMA should have been initialized by calling SYS_DMA_Initialize.
14297  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14298  The function SYS_DMA_ChannelSetup must be called to enable
14299  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
14300  match mode features.
14301  Parameters:
14302  handle - Handle of the DMA channel as returned by the
14303  SYS_DMA_ChannelAllocate function.
14304  pattern - The pattern that needs to be matched to abort a DMA transfer.
14305  length - Match pattern length can be 1-byte or 2-byte.
14306  ignore - Enable/Disable a byte between a 2-byte pattern match.
14307  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
14308  from the match abort pattern(16-bit)
14309  Returns:
14310  None.
14311  Example:
14312  <code>
14313  // Example 1
14314  // The following code is for a device with an 8-bit pattern value and no
14315  // support for pattern match ignore feature
14316  // 'handle' is a valid handle returned
14317  // by the SYS_DMA_ChannelAllocate function.
14318  uint16_t pattern;
14319  DMA_PATTERN_LENGTH length;
14320  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14321  uint8_t ignorePattern;
14322  pattern = 0x00; //Stop transfer on detection of a NULL character
14323  length = DMA_PATTERN_LENGTH_NONE;
14324  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
14325  ignorePattern = 0;
14326  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14327  ignoreEnable, ignorePattern);
14328  // Example 2
14329  // The following code is for a device with a 16-bit pattern value and
14330  // support for pattern match ignore feature
14331  // 'handle' is a valid handle returned
14332  // by the SYS_DMA_ChannelAllocate function.
14333  uint16_t pattern;
14334  DMA_PATTERN_LENGTH length;
14335  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14336  uint8_t ignorePattern;
14337  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
14338  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
14339  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
14340  ignorePattern = 0x00; \\ Any null character between the termination pattern
14341  \\ '\r' and '\n' is ignored.
14342  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14343  ignore, ignorePattern);
14344  </code>
14345  Remarks:
14346  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
14347  Not all features are available on all devices.
14348  Refer to the specific device data sheet for details.
14349 */
14350 
14351 void
14353  SYS_DMA_CHANNEL_HANDLE handle ,
14354  uint16_t pattern ,
14355  DMA_PATTERN_LENGTH length ,
14357  uint8_t ignorePattern ) ;
14358 //******************************************************************************
14359 /* Function:
14360  void SYS_DMA_ChannelCRCSet
14361  (
14362  SYS_DMA_CHANNEL_HANDLE handle,
14363  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
14364  )
14365  Summary:
14366  Sets up the CRC operation mode.
14367  Description:
14368  This function sets up the CRC computation features.
14369  Precondition:
14370  DMA should have been initialized by calling SYS_DMA_Initialize.
14371  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14372  The function SYS_DMA_ChannelSetup must be called to enable
14373  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14374  Parameters:
14375  handle - Handle of the DMA channel as returned by the
14376  SYS_DMA_ChannelAllocate function.
14377  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
14378  crc.mode - Compute the CRC in Background/Append mode.
14379  crc.polyLength - Denotes the length of the polynomial.
14380  crc.bitOrder - CRC is calculated LSb/MSb first.
14381  crc.byteOrder - Byte selection order input pre-CRC Generator
14382  crc.writeOrder - Write byte order selection post-CRC computation
14383  crc.data - Computed/Seed CRC
14384  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
14385  when mode is LFSR
14386  Returns:
14387  None.
14388  Example:
14389  <code>
14390  //Example 1
14391  // DMA calculation using the CRC background mode
14392  // 'handle' is a valid handle returned
14393  // by the SYS_DMA_ChannelAllocate function.
14394  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
14395  crc.type = DMA_CRC_LFSR;
14396  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
14397  crc.polyLength = 16;
14398  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
14399  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
14400  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
14401  crc.data = 0xFFFF;
14402  crc.xorBitMask = 0x1021;
14403  SYS_DMA_ChannelCRCSet(handle, crc);
14404  </code>
14405  Remarks:
14406  This feature may not be available on all devices. Refer to the specific device
14407  data sheet to determine availability.
14408 */
14409 
14410 void
14412  SYS_DMA_CHANNEL_HANDLE handle ,
14414 //******************************************************************************
14415 /* Function:
14416  uint32_t SYS_DMA_ChannelCRCGet(void)
14417  Summary:
14418  Returns the computed CRC.
14419  Description:
14420  This function returns the computed CRC
14421  Precondition:
14422  DMA should have been initialized by calling SYS_DMA_Initialize.
14423  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14424  The function SYS_DMA_ChannelSetup must be called to enable
14425  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14426  The CRC generator must have been previously setup using
14427  SYS_DMA_ChannelCRCSet.
14428  Parameters:
14429  None
14430  Returns:
14431  uint32_t - The Computed CRC.
14432  Example:
14433  <code>
14434  uint32_t computedCRC;
14435  computedCRC = SYS_DMA_ChannelCRCGet();
14436  </code>
14437  Remarks:
14438  To get the computed CRC value this function must be called after the block
14439  transfer completion event (i.e., after getting and processing the callback
14440  registered with SYS_DMA_ChannelTransferEventHandlerSet).
14441  This feature may not be available on all devices. Refer to the specific device
14442  data sheet to determine availability.
14443 */
14444 
14445 uint32_t
14446  SYS_DMA_ChannelCRCGet ( void ) ;
14447 //******************************************************************************
14448 /* Function:
14449  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
14450  Summary:
14451  Enables a channel.
14452  Description:
14453  This function enables a channel.
14454  Precondition:
14455  DMA should have been initialized by calling SYS_DMA_Initialize.
14456  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14457  The function SYS_DMA_ChannelSetup must have been called to setup and
14458  enable the required features.
14459  Parameters:
14460  handle - Handle of the DMA channel as returned by the
14461  SYS_DMA_ChannelAllocate function.
14462  Returns:
14463  None.
14464  Example:
14465  <code>
14466  // 'handle' is a valid handle returned
14467  // by the SYS_DMA_ChannelAllocate function.
14468  SYS_DMA_ChannelEnable(handle);
14469  </code>
14470  Remarks:
14471  This function may not required to be called when starting DMA setup
14472  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
14473  But may be needed to be called in the registered callback to enable the
14474  channel and continue the data transfer with the existing transfer parameters
14475  previously set with 'SYS_DMA_ChannelTransferAdd'.
14476  The DMA channel is by default disabled on the completion of block
14477  transfer(callback generated)
14478 */
14479 
14480 void
14482  SYS_DMA_CHANNEL_HANDLE handle ) ;
14483 //******************************************************************************
14484 /* Function:
14485  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
14486  Summary:
14487  Disables a channel.
14488  Description:
14489  This function disables a channel.
14490  Precondition:
14491  DMA should have been initialized by calling SYS_DMA_Initialize.
14492  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14493  The function SYS_DMA_ChannelSetup must have been called to setup and
14494  enable the required features.
14495  A DMA channel should have been enabled either by calling
14496  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
14497  Parameters:
14498  handle - Handle of the DMA channel as returned by the
14499  SYS_DMA_ChannelAllocate function.
14500  Returns:
14501  None.
14502  Example:
14503  <code>
14504  // 'handle' is a valid handle returned
14505  // by the SYS_DMA_ChannelAllocate function.
14506  SYS_DMA_ChannelDisable(handle);
14507  </code>
14508  Remarks:
14509  None.
14510 */
14511 
14512 void
14514  SYS_DMA_CHANNEL_HANDLE handle ) ;
14515 //******************************************************************************
14516 /* Function:
14517  void SYS_DMA_ChannelTransferAdd
14518  (
14519  SYS_DMA_CHANNEL_HANDLE handle,
14520  const void *srcAddr, size_t srcSize
14521  const void *destAddr, size_t destSize,
14522  size_t cellSize
14523  )
14524  Summary:
14525  Adds a data transfer to a DMA channel and Enables the channel to start
14526  data transfer.
14527  Description:
14528  This function adds a data transfer characteristics for a DMA channel. The
14529  The source and the destination addresses, source and destination lengths,
14530  The number of bytes transferred per cell event are set. It also enables
14531  the channel to start data transfer.
14532  If the requesting client registered an event callback with the service,
14533  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
14534  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
14535  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
14536  processed successfully.
14537  Precondition:
14538  DMA should have been initialized by calling SYS_DMA_Initialize.
14539  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14540  The function SYS_DMA_ChannelSetup must have been called to setup and
14541  enable the required features.
14542  Parameters:
14543  handle - Handle of the DMA channel as returned by the
14544  SYS_DMA_ChannelAllocate function.
14545  srcAddr - Source of the DMA transfer
14546  srcSize - Size of the source
14547  destAddr - Destination of the DMA transfer
14548  destSize - Size of the destination
14549  cellSize - Size of the cell
14550  Returns:
14551  None.
14552  Example:
14553  <code>
14554  // Add 10 bytes of data transfer to UART TX
14555  // 'handle' is a valid handle returned
14556  // by the SYS_DMA_ChannelAllocate function.
14557  MY_APP_OBJ myAppObj;
14558  uint8_t buf[10];
14559  void *srcAddr;
14560  void *destAddr;
14561  size_t srcSize;
14562  size_t destSize;
14563  size_t cellSize;
14564  srcAddr = (uint8_t *) buf;
14565  srcSize = 10;
14566  destAddr = (uin8_t*) &U2TXREG;
14567  destSize = 1;
14568  cellSize = 1;
14569  // User registers an event handler with system service. This is done once
14570  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14571  (uintptr_t)&myAppObj);
14572  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14573  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14574  {
14575  // Error handling here
14576  }
14577  // Event Processing Technique. Event is received when
14578  // the transfer is processed.
14579  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14580  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14581  {
14582  switch(event)
14583  {
14584  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14585  // This means the data was transferred.
14586  break;
14587  case SYS_DMA_TRANSFER_EVENT_ERROR:
14588  // Error handling here.
14589  break;
14590  default:
14591  break;
14592  }
14593  }
14594  </code>
14595  Remarks:
14596  For PIC32MZ series of devices, if the source/destination addresses are
14597  RAM memory addresses, the the source/destination buffers
14598  should be made coherent to avoid the cache coherency issues.
14599  For example:
14600  <code>
14601  uint8_t buffer[1024];
14602  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14603  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14604  </code>
14605 */
14606 
14607 void
14609  SYS_DMA_CHANNEL_HANDLE handle ,
14610  const void * srcAddr ,
14611  size_t srcSize ,
14612  const void * destAddr ,
14613  size_t destSize ,
14614  size_t cellSize ) ;
14615 //******************************************************************************
14616 /* Function:
14617  void SYS_DMA_ChannelTransferSet
14618  (
14619  SYS_DMA_CHANNEL_HANDLE handle,
14620  const void *srcAddr, size_t srcSize
14621  const void *destAddr, size_t destSize,
14622  size_t cellSize
14623  )
14624  Summary:
14625  Sets up a data transfer to a DMA channel.
14626  Description:
14627  This function sets up data transfer characteristics for a DMA channel. The
14628  The source and the destination addresses, source and destination lengths,
14629  The number of bytes transferred per cell event are set.
14630  This function does not enables the DMA channel. The channel has to be explicitly
14631  enabled to start the data transfer.
14632  The above functions could be used in situations where in the user intends to
14633  setup transfer parameters but do not intend to enable the channel immediately.
14634  For example to chain to DMA channels in a cyclic order where the channels remains
14635  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14636  condition occurs.
14637  Precondition:
14638  DMA should have been initialized by calling SYS_DMA_Initialize.
14639  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14640  The function SYS_DMA_ChannelSetup must have been called to setup and
14641  enable the required features.
14642  Parameters:
14643  handle - Handle of the DMA channel as returned by the
14644  SYS_DMA_ChannelAllocate function.
14645  srcAddr - Source of the DMA transfer
14646  srcSize - Size of the source
14647  destAddr - Destination of the DMA transfer
14648  destSize - Size of the destination
14649  cellSize - Size of the cell
14650  Returns:
14651  None.
14652  Example:
14653  <code>
14654  // Set up 10 bytes of data transfer to UART TX
14655  // 'handle' is a valid handle returned
14656  // by the SYS_DMA_ChannelAllocate function.
14657  MY_APP_OBJ myAppObj;
14658  uint8_t buf[10];
14659  void *srcAddr;
14660  void *destAddr;
14661  size_t srcSize;
14662  size_t destSize;
14663  size_t cellSize;
14664  srcAddr = (uint8_t *) buf;
14665  srcSize = 10;
14666  destAddr = (uin8_t*) &U2TXREG;
14667  destSize = 1;
14668  cellSize = 1;
14669  // User registers an event handler with system service. This is done once
14670  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14671  (uintptr_t)&myAppObj);
14672  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14673  SYS_DMA_ChannelEnable(handle);
14674  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14675  {
14676  // Error handling here
14677  }
14678  // Event Processing Technique. Event is received when
14679  // the transfer is processed.
14680  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14681  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14682  {
14683  switch(event)
14684  {
14685  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14686  // This means the data was transferred.
14687  break;
14688  case SYS_DMA_TRANSFER_EVENT_ERROR:
14689  // Error handling here.
14690  break;
14691  default:
14692  break;
14693  }
14694  }
14695  </code>
14696  Remarks:
14697  For PIC32MZ series of devices, if the source/destination addresses are
14698  RAM memory addresses, the the source/destination buffers
14699  should be made coherent to avoid the cache coherency issues.
14700  For example:
14701  <code>
14702  uint8_t buffer[1024];
14703  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14704  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14705  </code>
14706 */
14707 
14708 void
14710  SYS_DMA_CHANNEL_HANDLE handle ,
14711  const void * srcAddr ,
14712  size_t srcSize ,
14713  const void * destAddr ,
14714  size_t destSize ,
14715  size_t cellSize ) ;
14716 //******************************************************************************
14717 /* Function:
14718  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14719  Summary:
14720  Returns the number of bytes transferred from source.
14721  Description:
14722  When a data transfer request is submitted. At any time while the transmission
14723  is in progress the size of the amount of data transferred from source
14724  can be known by calling this function.
14725  Precondition:
14726  DMA should have been initialized by calling SYS_DMA_Initialize.
14727  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14728  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14729  SYS_DMA_ChannelTransferSet.
14730  Parameters:
14731  handle - A valid channel handle, returned from the system service's
14732  Allocate routine
14733  Returns:
14734  size_t - Returns the number of bytes transferred from the submitted size.
14735  Example:
14736  <code>
14737  // 'handle' is a valid handle returned
14738  // by the SYS_DMA_ChannelAllocate function.
14739  MY_APP_OBJ myAppObj;
14740  uint8_t buf[10];
14741  void *srcAddr;
14742  void *destAddr;
14743  size_t srcSize;
14744  size_t destSize;
14745  size_t cellSize;
14746  size_t transferredSize;
14747  srcAddr = (uint8_t *) buf;
14748  srcSize = 10;
14749  destAddr = (uin8_t*) &U2TXREG;
14750  destSize = 1;
14751  cellSize = 1;
14752  channelHandle = SYS_DMA_ChannelAllocate(channel);
14753  // User registers an event handler with system service. This is done once
14754  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14755  (uintptr_t)&myAppObj);
14756  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14757  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14758  {
14759  // Error handling here
14760  }
14761  // The data is being transferred after adding the transfer to the DMA channel.
14762  // The user can get to know dynamically the amount of data
14763  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14764  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14765  </code>
14766  Remarks:
14767  None.
14768 */
14769 
14770 size_t
14772  SYS_DMA_CHANNEL_HANDLE handle ) ;
14773 //******************************************************************************
14774 /* Function:
14775  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14776  Summary:
14777  Returns the number of bytes transferred to destination.
14778  Description:
14779  When a data transfer request is submitted. At any time while the transmission
14780  is in progress the size of the amount of data transferred to destination
14781  can be known by calling this function.
14782  Precondition:
14783  DMA should have been initialized by calling SYS_DMA_Initialize.
14784  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14785  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14786  SYS_DMA_ChannelTransferSet.
14787  Parameters:
14788  handle - A valid channel handle, returned from the system service's
14789  Allocate routine
14790  Returns:
14791  size_t - Returns the number of bytes received from the submitted size.
14792  Example:
14793  <code>
14794  // 'handle' is a valid handle returned
14795  // by the SYS_DMA_ChannelAllocate function.
14796  MY_APP_OBJ myAppObj;
14797  uint8_t buf[10];
14798  void *srcAddr;
14799  void *destAddr;
14800  size_t srcSize;
14801  size_t destSize;
14802  size_t cellSize;
14803  size_t transferredSize;
14804  srcAddr = (uin8_t*) &U2RXREG;
14805  srcSize = 1;
14806  destAddr = (uint8_t *) buf ;
14807  destSize = 10;
14808  cellSize = 1;
14809  channelHandle = SYS_DMA_ChannelAllocate(channel);
14810  // User registers an event handler with system service. This is done once
14811  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14812  (uintptr_t)&myAppObj);
14813  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14814  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14815  {
14816  // Error handling here
14817  }
14818  // The data is being transferred after adding the transfer to the DMA channel.
14819  // The user can get to know dynamically the amount of data
14820  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14821  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14822  </code>
14823  Remarks:
14824  None.
14825 */
14826 
14827 size_t
14829  SYS_DMA_CHANNEL_HANDLE handle ) ;
14830 //******************************************************************************
14831 /*
14832  Function:
14833  void SYS_DMA_ChannelTransferEventHandlerSet
14834  (
14835  SYS_DMA_CHANNEL_HANDLE handle,
14836  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14837  const uintptr_t contextHandle
14838  )
14839  Summary:
14840  This function allows a DMA system service client to set an event handler.
14841  Description:
14842  This function allows a client to set an event handler. The client may want
14843  to receive transfer related events in cases when it uses non-blocking read and
14844  write functions. The event handler should be set before the client
14845  intends to perform operations that could generate events.
14846  This function accepts a contextHandle parameter. This parameter could be
14847  set by the client to contain (or point to) any client specific data object
14848  that should be associated with this DMA channel.
14849  Precondition:
14850  DMA should have been initialized by calling SYS_DMA_Initialize.
14851  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14852  Parameters:
14853  handle - A valid channel handle, returned from the system service's
14854  Allocate routine
14855  eventHandler - Pointer to the event handler function.
14856  contextHandle - Value identifying the context of the application/driver/middleware
14857  that registered the event handling function.
14858  Returns:
14859  None.
14860  Example:
14861  <code>
14862  // 'handle' is a valid handle returned
14863  // by the SYS_DMA_ChannelAllocate function.
14864  MY_APP_OBJ myAppObj;
14865  uint8_t buf[10];
14866  void *srcAddr;
14867  void *destAddr;
14868  size_t srcSize;
14869  size_t destSize;
14870  size_t cellSize;
14871  srcAddr = (uint8_t *) buf;
14872  srcSize = 10;
14873  destAddr = (uin8_t*) &U2TXREG;
14874  destSize = 1;
14875  cellSize = 1;
14876  channelHandle = SYS_DMA_ChannelAllocate(channel);
14877  // User registers an event handler with system service. This is done once
14878  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14879  (uintptr_t)&myAppObj);
14880  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14881  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14882  {
14883  // Error handling here
14884  }
14885  // Event Processing Technique. Event is received when
14886  // the transfer is processed.
14887  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14888  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14889  {
14890  switch(event)
14891  {
14892  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14893  // This means the data was transferred.
14894  break;
14895  case SYS_DMA_TRANSFER_EVENT_ERROR:
14896  // Error handling here.
14897  break;
14898  default:
14899  break;
14900  }
14901  }
14902  </code>
14903  Remarks:
14904  None.
14905  */
14906 
14907 void
14909  SYS_DMA_CHANNEL_HANDLE handle ,
14910  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14911  const uintptr_t contextHandle ) ;
14912 // *****************************************************************************
14913 /* Function:
14914  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14915  Summary:
14916  This function returns the error(if any) associated with the last client
14917  request.
14918  Description:
14919  This function returns the error(if any) associated with the last client
14920  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14921  the client can call this function to know the error cause.
14922  The error status will be updated on every operation and should be read
14923  frequently (ideally immediately after the service operation has completed)
14924  to know the relevant error status.
14925  Precondition:
14926  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14927  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14928  handle.
14929  Parameters:
14930  handle - Handle of the DMA channel as returned by the
14931  SYS_DMA_ChannelAllocate function.
14932  Returns:
14933  A SYS_DMA_ERROR type indicating last known error status.
14934  Example:
14935  <code>
14936  // 'handle' is a valid handle returned
14937  // by the SYS_DMA_ChannelAllocate function.
14938  // pDmaSrc, pDmaDst is the source,destination address
14939  // txferSrcSize, txferDesSize is the source,destination transfer size
14940  // cellSize is the cell size
14941  MY_APP_OBJ myAppObj;
14942  // Client registers an event handler with service. This is done once
14943  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14944  (uintptr_t)&myAppObj );
14945  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14946  DMA_TRIGGER_SOURCE_NONE);
14947  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14948  pDmaDst,txferDesSize,cellSize);
14949  SYS_DMA_ChannelForceStart(handle);
14950  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14951  {
14952  // Error handling here
14953  }
14954  // Event Processing Technique. Event is received when
14955  // the transfer is processed.
14956  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14957  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14958  {
14959  switch(event)
14960  {
14961  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14962  // This means the data was transferred.
14963  break;
14964  case SYS_DMA_TRANSFER_EVENT_ERROR:
14965  // Error handling here.
14966  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14967  {
14968  // There was an address error.
14969  // Do error handling here.
14970  }
14971  break;
14972  default:
14973  break;
14974  }
14975  }
14976  </code>
14977  Remarks:
14978  It is the client's responsibility to make sure that the error status is
14979  obtained frequently. The service will update the error status
14980  regardless of whether this has been examined by the client.
14981 */
14982 
14985  SYS_DMA_CHANNEL_HANDLE handle ) ;
14986 //******************************************************************************
14987 /* Function:
14988  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14989  Summary:
14990  Force start of transfer on the selected channel.
14991  Description:
14992  The function force start a DMA transfer to occur for the selected channel.
14993  Precondition:
14994  DMA should have been initialized by calling SYS_DMA_Initialize.
14995  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14996  The function SYS_DMA_ChannelSetup must have been called to setup and
14997  enable the required features.
14998  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14999  Parameters:
15000  handle - Handle of the DMA channel as returned by the
15001  SYS_DMA_ChannelAllocate function.
15002  Returns:
15003  None.
15004  Example:
15005  <code>
15006  // 'handle' is a valid handle returned
15007  // by the SYS_DMA_ChannelAllocate function.
15008  // pDmaSrc, pDmaDst is the source,destination address
15009  // txferSrcSize, txferDesSize is the source,destination transfer size
15010  // cellSize is the cell size
15011  MY_APP_OBJ myAppObj;
15012  // Client registers an event handler with service. This is done once
15013  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
15014  (uintptr_t)&myAppObj );
15015  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
15016  DMA_TRIGGER_SOURCE_NONE);
15017  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
15018  pDmaDst,txferDesSize,cellSize);
15019  SYS_DMA_ChannelForceStart(handle);
15020  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
15021  {
15022  // Error handling here
15023  }
15024  // Event Processing Technique. Event is received when
15025  // the transfer is processed.
15026  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
15027  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
15028  {
15029  switch(event)
15030  {
15031  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
15032  // This means the data was transferred.
15033  break;
15034  case SYS_DMA_TRANSFER_EVENT_ERROR:
15035  // Error handling here.
15036  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
15037  {
15038  // There was an address error.
15039  // Do error handling here.
15040  }
15041  break;
15042  default:
15043  break;
15044  }
15045  }
15046  </code>
15047  Remarks:
15048  This function must be used to start the DMA transfer when the channel has been
15049  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
15050 */
15051 
15052 void
15054  SYS_DMA_CHANNEL_HANDLE handle ) ;
15055 //******************************************************************************
15056 /* Function:
15057  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
15058  Summary:
15059  Force abort of transfer on the selected channel.
15060  Description:
15061  The function aborts a DMA transfer to occur for the selected channel.
15062  Precondition:
15063  DMA should have been initialized by calling SYS_DMA_Initialize.
15064  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15065  The function SYS_DMA_ChannelSetup must have been called to setup and
15066  enable the required features.
15067  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
15068  Parameters:
15069  handle - Handle of the DMA channel as returned by the
15070  SYS_DMA_ChannelAllocate function.
15071  Returns:
15072  None.
15073  Example:
15074  <code>
15075  // 'handle' is a valid handle returned
15076  // by the SYS_DMA_ChannelAllocate function.
15077  // pDmaSrc, pDmaDst is the source,destination address
15078  // txferSrcSize, txferDesSize is the source,destination transfer size
15079  // cellSize is the cell size
15080  MY_APP_OBJ myAppObj;
15081  // Client registers an event handler with service. This is done once
15082  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
15083  (uintptr_t)&myAppObj );
15084  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
15085  DMA_TRIGGER_SOURCE_NONE);
15086  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
15087  pDmaDst,txferDesSize,cellSize);
15088  SYS_DMA_ChannelForceStart(handle);
15089  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
15090  {
15091  // Error handling here
15092  }
15093  ....
15094  ....
15095  // Client may need to abort a transfer
15096  SYS_DMA_ChannelForceAbort(handle);
15097  // Event Processing Technique. Event is received when
15098  // the transfer is processed.
15099  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
15100  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
15101  {
15102  switch(event)
15103  {
15104  case SYS_DMA_TRANSFER_EVENT_ABORT:
15105  // This means the data was transferred.
15106  break;
15107  case SYS_DMA_TRANSFER_EVENT_ERROR:
15108  // Error handling here.
15109  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
15110  {
15111  // There was an address error.
15112  // Do error handling here.
15113  }
15114  break;
15115  default:
15116  break;
15117  }
15118  }
15119  </code>
15120  Remarks:
15121  This function must be used to abort the DMA transfer when the channel has been
15122  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
15123  and SYS_DMA_ChannelAbortEventSet has not been called.
15124 */
15125 
15126 void
15128  SYS_DMA_CHANNEL_HANDLE handle ) ;
15129 //******************************************************************************
15130 /* Function:
15131  void SYS_DMA_ChannelAbortEventSet
15132  (
15133  SYS_DMA_CHANNEL_HANDLE handle,
15134  DMA_TRIGGER_SOURCE eventSrc
15135  )
15136  Summary:
15137  Sets an event source and enables cell transfer abort event for the same
15138  for the selected channel.
15139  Description:
15140  This functions enables a cell transfer abort event for the selected source
15141  event.
15142  Precondition:
15143  DMA should have been initialized by calling SYS_DMA_Initialize.
15144  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15145  The function SYS_DMA_ChannelSetup must have been called to setup and
15146  enable the required features.
15147  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
15148  Parameters:
15149  handle - Handle of the DMA channel as returned by the
15150  SYS_DMA_ChannelAllocate function.
15151  eventSrc - The event causing the cell transfer abort
15152  Returns:
15153  None.
15154  Example:
15155  <code>
15156  // 'handle' is a valid handle returned
15157  // by the SYS_DMA_ChannelAllocate function.
15158  // pDmaSrc, pDmaDst is the source,destination address
15159  // txferSrcSize, txferDesSize is the source,destination transfer size
15160  // cellSize is the cell size
15161  MY_APP_OBJ myAppObj;
15162  // Client registers an event handler with service. This is done once
15163  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
15164  (uintptr_t)&myAppObj );
15165  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
15166  DMA_TRIGGER_SOURCE_NONE);
15167  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
15168  pDmaDst,txferDesSize,cellSize);
15169  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
15170  SYS_DMA_ChannelForceStart(handle);
15171  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
15172  {
15173  // Error handling here
15174  }
15175  // Event Processing Technique. Event is received when
15176  // the transfer is processed.
15177  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
15178  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
15179  {
15180  switch(event)
15181  {
15182  case SYS_DMA_TRANSFER_EVENT_ABORT:
15183  // This means the data was transferred.
15184  break;
15185  case SYS_DMA_TRANSFER_EVENT_ERROR:
15186  // Error handling here.
15187  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
15188  {
15189  // There was an address error.
15190  // Do error handling here.
15191  }
15192  break;
15193  default:
15194  break;
15195  }
15196  }
15197  </code>
15198  Remarks:
15199  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
15200  current DMA transfer will be aborted. The behavior is a same as calling
15201  SYS_DMA_ChannelForceAbort.
15202 */
15203 
15204 void
15206  SYS_DMA_CHANNEL_HANDLE handle ,
15207  DMA_TRIGGER_SOURCE eventSrc ) ;
15208 //******************************************************************************
15209 /* Function:
15210  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
15211  Summary:
15212  Returns the busy status of the specified DMA channel.
15213  Description:
15214  This function returns the busy status of the selected DMA channel
15215  Precondition:
15216  DMA should have been initialized by calling SYS_DMA_Initialize.
15217  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15218  Parameters:
15219  handle - Handle of the DMA channel as returned by the
15220  SYS_DMA_ChannelAllocate function.
15221  Returns:
15222  bool - true, if the selected DMA channel is active or enabled
15223  - false, if the selected DMA channel is inactive or disabled
15224  Example:
15225  <code>
15226  bool busyStat;
15227  busyStat = SYS_DMA_ChannelGetBusy(handle);
15228  </code>
15229  Remarks:
15230  This feature may not be available on all devices. Refer to the specific device
15231  data sheet to determine availability.
15232 */
15233 
15234 bool
15236  SYS_DMA_CHANNEL_HANDLE handle ) ;
15237 //******************************************************************************
15238 /* Function:
15239  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
15240  Summary:
15241  Suspend DMA operation on the specified DMA channel.
15242  Description:
15243  This function suspends the DMA operation on the DMA channel
15244  specified by the channel handle.
15245  Precondition:
15246  DMA should have been initialized by calling SYS_DMA_Initialize.
15247  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15248  Parameters:
15249  handle - Handle of the DMA channel as returned by the
15250  SYS_DMA_ChannelAllocate function.
15251  Returns:
15252  None.
15253  Example:
15254  <code>
15255  SYS_DMA_ChannelSuspend(handle);
15256  </code>
15257  Remarks:
15258  This feature may not be available on all devices. Refer to the specific device
15259  data sheet to determine availability.
15260 */
15261 
15262 void
15264  SYS_DMA_CHANNEL_HANDLE handle ) ;
15265 //******************************************************************************
15266 /* Function:
15267  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
15268  Summary:
15269  Resume DMA operation on the specified DMA channel.
15270  Description:
15271  This function resumes the DMA operation on the DMA channel
15272  specified by the channel handle.
15273  Precondition:
15274  DMA should have been initialized by calling SYS_DMA_Initialize.
15275  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15276  Parameters:
15277  handle - Handle of the DMA channel as returned by the
15278  SYS_DMA_ChannelAllocate function.
15279  Returns:
15280  None.
15281  Example:
15282  <code>
15283  SYS_DMA_ChannelResume(handle);
15284  </code>
15285  Remarks:
15286  This feature may not be available on all devices. Refer to the specific device
15287  data sheet to determine availability.
15288 */
15289 
15290 void
15292  SYS_DMA_CHANNEL_HANDLE handle ) ;
15293 // *****************************************************************************
15294 // *****************************************************************************
15295 // Section: Global DMA Management Functions
15296 // *****************************************************************************
15297 // *****************************************************************************
15298 //******************************************************************************
15299 /* Function:
15300  void SYS_DMA_Suspend(void)
15301  Summary:
15302  Suspend DMA transfers.
15303  Description:
15304  This function suspends DMA transfers to allow CPU uninterrupted access
15305  to data bus
15306  Precondition:
15307  DMA should have been initialized by calling SYS_DMA_Initialize.
15308  Parameters:
15309  None.
15310  Returns:
15311  None.
15312  Example:
15313  <code>
15314  SYS_DMA_Suspend();
15315  </code>
15316  Remarks:
15317  None
15318 */
15319 
15320 void
15321  SYS_DMA_Suspend ( void ) ;
15322 //******************************************************************************
15323 /* Function:
15324  void SYS_DMA_Resume(void)
15325  Summary:
15326  Resume DMA operations.
15327  Description:
15328  This function disables DMA suspend. It resumes the DMA operation suspended
15329  by calling SYS_DMA_Suspend. The DMA operates normally.
15330  Precondition:
15331  DMA should have been initialized by calling SYS_DMA_Initialize.
15332  Parameters:
15333  None.
15334  Returns:
15335  None.
15336  Example:
15337  <code>
15338  SYS_DMA_Resume();
15339  </code>
15340  Remarks:
15341  None
15342 */
15343 
15344 void
15345  SYS_DMA_Resume ( void ) ;
15346 //******************************************************************************
15347 /* Function:
15348  bool SYS_DMA_IsBusy(void)
15349  Summary:
15350  Returns the busy status of the DMA module.
15351  Description:
15352  This function returns the busy status of the DMA module
15353  Precondition:
15354  DMA should have been initialized by calling SYS_DMA_Initialize.
15355  Parameters:
15356  None.
15357  Returns:
15358  Boolean
15359  - true - The DMA module is active
15360  - false - The DMA module is inactive and disabled
15361  <code>
15362  bool busyStat;
15363  busyStat = SYS_DMA_IsBusy();
15364  </code>
15365  Remarks:
15366  This feature may not be available on all devices. Refer to the specific device
15367  data sheet to determine availability.
15368 */
15369 
15370 bool
15371  SYS_DMA_IsBusy ( void ) ;
15372 // *****************************************************************************
15373 // *****************************************************************************
15374 // Section: Deprecated functions
15375 // *****************************************************************************
15376 // *****************************************************************************
15377 //*******************************************************************************
15378 /* Function:
15379  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15380  Summary:
15381  This function is deprecated. Use SYS_DMA_Tasks function.
15382  */
15383 
15384 void
15385  SYS_DMA_Tasks (
15386  SYS_MODULE_OBJ object ,
15387  DMA_CHANNEL activeChannel ) ;
15388 //*****************************************************************************
15389 /* Function:
15390  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
15391  Summary:
15392  This function is deprecated. Use SYS_DMA_Tasks function.
15393  */
15394 
15395 void
15397  SYS_MODULE_OBJ object ) ;
15398 //*******************************************************************************
15399 /* Function:
15400  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15401  Summary:
15402  This function is deprecated. Use SYS_DMA_Tasks function.
15403  */
15404 
15405 void
15407  SYS_MODULE_OBJ object ,
15408  DMA_CHANNEL activeChannel ) ;
15409  // #ifndef _SYS_DMA_H
15410 /*******************************************************************************
15411  End of File
15412 */
15413 
15414 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
15415 /* CLOSE_FILE Include File */
15416 
15417 // DOM-IGNORE-BEGIN
15418 // DOM-IGNORE-END
15419 // *****************************************************************************
15420 // *****************************************************************************
15421 // Section: Data Types
15422 // *****************************************************************************
15423 // *****************************************************************************
15424 // *****************************************************************************
15425 /* Driver USART Module Index
15426  Summary:
15427  USART driver index definitions
15428  Description:
15429  These constants provide USART driver index definitions.
15430  Remarks:
15431  These constants should be used in place of hard-coded numeric literals.
15432  These values should be passed into the DRV_USART_Initialize and
15433  DRV_USART_Open routines to identify the driver instance in use.
15434 */
15435 #define DRV_USART_INDEX_0 0
15436 #define DRV_USART_INDEX_1 1
15437 #define DRV_USART_INDEX_2 2
15438 #define DRV_USART_INDEX_3 3
15439 #define DRV_USART_INDEX_4 4
15440 #define DRV_USART_INDEX_5 5
15441 // *****************************************************************************
15442 /* USART Driver Module Count
15443  Summary:
15444  Number of valid USART drivers
15445  Description:
15446  This constant identifies the maximum number of USART Driver instances that
15447  should be defined in the system. Defining more instances than this
15448  constant will waste RAM memory space.
15449  This constant can also be used by the system and application to identify the
15450  number of USART instances on this microcontroller.
15451  Remarks:
15452  This value is part-specific.
15453 */
15454 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
15455 // *****************************************************************************
15456 /* USART Driver Write Error
15457  Summary:
15458  USART Driver Write Error.
15459  Description:
15460  This constant is returned by DRV_USART_Write() function when an error
15461  occurs.
15462  Remarks:
15463  None.
15464 */
15465 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
15466 // *****************************************************************************
15467 /* USART Driver Read Error
15468  Summary:
15469  USART Driver Read Error.
15470  Description:
15471  This constant is returned by DRV_USART_Read() function when an error
15472  occurs.
15473  Remarks:
15474  None.
15475 */
15476 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
15477 // *****************************************************************************
15478 /* USART Driver Buffer Handle
15479  Summary:
15480  Handle identifying a read or write buffer passed to the driver.
15481  Description:
15482  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
15483  or DRV_USART_BufferAddWrite functions. This handle is associated with the
15484  buffer passed into the function and it allows the application to track the
15485  completion of the data from (or into) that buffer. The buffer handle value
15486  returned from the "buffer add" function is returned back to the client
15487  by the "event handler callback" function registered with the driver.
15488  The buffer handle assigned to a client request expires when the client has
15489  been notified of the completion of the buffer transfer (after event handler
15490  function that notifies the client returns) or after the buffer has been
15491  retired by the driver if no event handler callback was set.
15492  Remarks:
15493  None
15494 */
15495 
15496 typedef
15497 uintptr_t
15499 // *****************************************************************************
15500 /* USART Driver Invalid Buffer Handle
15501  Summary:
15502  Definition of an invalid buffer handle.
15503  Description:
15504  This is the definition of an invalid buffer handle. An invalid buffer handle
15505  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
15506  functions if the buffer add request was not successful.
15507  Remarks:
15508  None
15509 */
15510 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
15511 // *****************************************************************************
15512 /* USART Modes of Operation
15513  Summary:
15514  Identifies the modes of the operation of the USART module
15515  Description:
15516  This data type identifies the modes of the operation of the USART module.
15517  Remarks:
15518  Not all modes are available on all devices. Refer to the specific device data
15519  sheet to determine availability.
15520 */
15521 
15522 typedef
15523  enum
15524  {
15525  /* USART works in IRDA mode */
15527  /* This is the normal point to point communication mode where the USART
15528  communicates directly with another USART by connecting it's Transmit signal
15529  to the external USART's Receiver signal and vice versa. An external
15530  transceiver may be connected to obtain RS-232 signal levels. This type of
15531  connection is typically full duplex. */
15533  /* This is a multi-point bus mode where the USART can communicate with
15534  many other USARTS on a bus using an address-based protocol such as RS-485.
15535  This mode is typically half duplex and the physical layer may require a
15536  transceiver. In this mode every USART on the bus is assigned an address and
15537  the number of data bits is 9 bits */
15539  /* Loopback mode internally connects the Transmit signal to the Receiver
15540  signal, looping data transmission back into this USART's own input. It is
15541  useful primarily as a test mode. */
15544 // *****************************************************************************
15545 /* USART Driver Buffer Events
15546  Summary
15547  Identifies the possible events that can result from a buffer add request.
15548  Description
15549  This enumeration identifies the possible events that can result from a
15550  buffer add request caused by the client calling either the
15551  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15552  Remarks:
15553  One of these values is passed in the "event" parameter of the event
15554  handling callback function that the client registered with the driver by
15555  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15556  transfer request is completed.
15557 */
15558 
15559 typedef
15560  enum
15561  {
15562  /* All data from or to the buffer was transferred successfully. */
15564  /* There was an error while processing the buffer transfer request. */
15566  /* Data transfer aborted (Applicable in DMA mode) */
15569 // *****************************************************************************
15570 /* USART Driver Buffer Result
15571  Summary
15572  Identifies the possible result of the buffer processing.
15573  Description
15574  This enumeration identifies the possible result of the buffer processing.
15575 
15576  Remarks:
15577  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15578  is in the free buffer pool.
15579 */
15580 
15581 typedef
15582  enum
15583  {
15584  /* Buffer handle is not valid*/
15586  /* Buffer handle has expired. */
15588  /* Buffer is removed from the queue succesfully*/
15590  /* Buffer removal failed because of unable to acquire the mutex
15591  * This is applicable in RTOS mode only */
15594 // *****************************************************************************
15595 /* USART Driver Buffer Event Handler Function Pointer
15596  Summary
15597  Pointer to a USART Driver Buffer Event handler function
15598  Description
15599  This data type defines the required function signature for the USART driver
15600  buffer event handling callback function. A client must register a pointer
15601  to a buffer event handling function whose function signature (parameter
15602  and return value types) match the types specified by this function pointer
15603  in order to receive buffer related event calls back from the driver.
15604  The parameters and return values and are described here and
15605  a partial example implementation is provided.
15606  Parameters:
15607  event - Identifies the type of event
15608  bufferHandle - Handle identifying the buffer to which the vent relates
15609  context - Value identifying the context of the application that registered
15610  the event handling function.
15611  Returns:
15612  None.
15613  Example:
15614  <code>
15615  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15616  DRV_USART_BUFFER_HANDLE bufferHandle,
15617  uintptr_t context )
15618  {
15619  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15620  switch(event)
15621  {
15622  case DRV_USART_BUFFER_EVENT_COMPLETE:
15623  // Handle the completed buffer.
15624  break;
15625  case DRV_USART_BUFFER_EVENT_ERROR:
15626  default:
15627  // Handle error.
15628  break;
15629  }
15630  }
15631  </code>
15632  Remarks:
15633  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15634  transferred successfully.
15635  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15636  transferred successfully. The DRV_USART_ErrorGet function can be called to
15637  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15638  called to find out how many bytes were processed.
15639  The bufferHandle parameter contains the buffer handle of the buffer that
15640  associated with the event.
15641  The context parameter contains the a handle to the client context,
15642  provided at the time the event handling function was registered using the
15643  DRV_USART_BufferEventHandlerSet function. This context handle value is
15644  passed back to the client as the "context" parameter. It can be any value
15645  necessary to identify the client context or instance (such as a pointer to
15646  the client's data) instance of the client that made the buffer add request.
15647  The event handler function executes in the driver peripheral's interrupt
15648  context when the driver is configured for interrupt mode operation. It is
15649  recommended of the application to not perform process intensive or blocking
15650  operations with in this function.
15651  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15652  be called in the event handler to add a buffer to the driver queue. These
15653  functions can only be called to add buffers to the driver whose event
15654  handler is running. For example, buffers cannot be added USART2 driver in
15655  USART1 driver event handler.
15656 */
15657 
15658 typedef
15660 DRV_USART_BUFFER_HANDLE bufferHandle ,
15661 uintptr_t context ) ;
15662 // *****************************************************************************
15663 /* USART Driver Byte Event Handler Function Pointer
15664  Summary
15665  Pointer to a USART Driver Byte Event handler function
15666  Description
15667  This data type defines the required function signature for the USART driver
15668  byte event handling callback function. A client must register a pointer to a
15669  byte event handling function whose function signature (parameter and return
15670  value types) match the types specified by this function pointer in order to
15671  receive byte related event calls back from the driver.
15672  Parameters:
15673  index - Identifier for the instance
15674  Returns:
15675  None.
15676  Example:
15677  <code>
15678  void APP_MyUsartTxEventHandler(void)
15679  {
15680  // Handle the transmit byte event
15681  }
15682  </code>
15683  Remarks:
15684  The event handler function executes in the driver peripheral's interrupt
15685  context when the driver is configured for interrupt mode operation. It is
15686  recommended that the application not perform process intensive or blocking
15687  operations with in this function.
15688 */
15689 
15690 typedef
15691 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15692 // *****************************************************************************
15693 /* USART Handshake Modes
15694  Summary:
15695  Identifies the handshaking modes supported by the USART driver.
15696  Description:
15697  This data type identifies the handshaking modes supported by the USART
15698  driver.
15699  Remarks:
15700  Not all modes are available on all devices. Refer to the specific device data
15701  sheet to determine availability.
15702 */
15703 
15704 typedef
15705  enum
15706  {
15707  /* Handshaking occurs in Flow Control Mode */
15708  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15709  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15710  ,
15711  /* Handshaking occurs in Simplex Mode */
15712  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15713  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15714  ,
15715  /* No Handshaking */
15716  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15717  2 /*DOM-IGNORE-END*/
15719 // *****************************************************************************
15720 /* USART Baud Set Result
15721  Summary:
15722  Identifies the results of the baud set function.
15723  Description:
15724  This data type identifies the results of the DRV_USART_BaudSet function.
15725  Remarks:
15726  None.
15727 */
15728 
15729 typedef
15730  enum
15731  {
15732  /* The driver was not able to change the baud */
15733  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15734  - 1 /*DOM-IGNORE-END*/
15735  ,
15736  /* The driver was able to change the baud successfully */
15739 // *****************************************************************************
15740 /* USART Line Control Set Result
15741  Summary:
15742  Identifies the results of the baud set function.
15743  Description:
15744  This data type identifies the results of the DRV_USART_LineControlSet
15745  function.
15746  Remarks:
15747  None.
15748 */
15749 
15750 typedef
15751  enum
15752  {
15753  /* The driver was not able to change the Line Control */
15754  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15755  - 1 /*DOM-IGNORE-END*/
15756  ,
15757  /* The driver was able to change the Line Control successfully */
15760 // *****************************************************************************
15761 /* USART Line Control Modes
15762  Summary:
15763  Identifies the line control modes supported by the USART driver.
15764  Description:
15765  This data type identifies the line control modes supported by the USART
15766  driver. Line control modes define the number of data bits, parity mode, and
15767  the number of stop bits in a USART transmit and receive frames.
15768  Remarks:
15769  The abbreviations used in the labels for the values of this enumeration
15770  follow the format <data><parity><stop>, where:
15771  <data> is the number of data bits
15772  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15773  added to obtain an even number of bits, or "ODD" for one bit
15774  added to obtain an odd number of bits.
15775  <stop> is the number of Stop bits
15776 */
15777 
15778 typedef
15779  enum
15780  {
15781  /* 8 data bits, no parity bit, 1 stop bit */
15782  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15783  USART_8N1 /* DOM-IGNORE-END*/
15784  ,
15785  /* 9 data bits, no parity bit, 1 stop bit */
15786  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15787  USART_9N1 /* DOM-IGNORE-END*/
15788  ,
15789  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15790  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15791  USART_8E1 /* DOM-IGNORE-END*/
15792  ,
15793  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15794  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15795  USART_8E2 /* DOM-IGNORE-END*/
15796  ,
15797  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15798  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15799  USART_8O1 /* DOM-IGNORE-END*/
15800  ,
15801  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15802  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15803  USART_8O2 /* DOM-IGNORE-END*/
15804  ,
15805  /* 8 data bits, no parity bit, 2 stop bit */
15806  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15807  USART_8N2 /* DOM-IGNORE-END*/
15808  ,
15809  /* 9 data bits, no parity bit, 2 stop bit */
15810  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15811  USART_9N2 /* DOM-IGNORE-END*/
15813 // *****************************************************************************
15814 /* USART Initialization flags
15815  Summary:
15816  Flags identifying features that can be enabled when the driver is
15817  initialized.
15818  Description:
15819  This enumeration defines flags identifying features that can be enabled
15820  when the driver is initialized.
15821  Remarks:
15822  These flags can be logically ORed together. They are passed into the
15823  DRV_USART_Initialize function through the "flags" member of the
15824  DRV_USART_INIT structure.
15825 */
15826 
15827 typedef
15828  enum
15829  {
15830  /* Use this if no flags need to be set */
15831  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15832  0 /*DOM-IGNORE-END*/
15833  ,
15834  /* Flag to enable "wake on start" operation. If supported and enabled,
15835  this feature will allow the USART to wake-up the device when a
15836  Start bit is received. This option should be selected only when the
15837  device is to placed in Sleep mode. Note that enabling this bit will
15838  also cause the first received character to be lost. Refer to the specific
15839  device data sheet for more information. */
15841  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15842  ,
15843  /* Flag to enable auto baud detection. If supported and enabled, this
15844  feature will allow the USART to automatically detect the baud rate in
15845  use. */
15846  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15847  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15848  ,
15849  /* Flag to enable stop in idle. If supported and enabled , this
15850  feature will allow the USART to stop when the CPU enters Idle
15851  mode */
15853  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15855 // *****************************************************************************
15856 /* Operation Mode Initialization Data
15857  Summary:
15858  Defines the initialization data required for different operation modes of
15859  USART.
15860  Description:
15861  This data type defines the initialization data required for different
15862  operation modes of the USART.
15863  Remarks:
15864  None
15865 */
15866 
15867 typedef
15868  union
15869  {
15870  /* Initialization for Addressed mode */
15871  struct
15872  {
15873  /* Address of the device. */
15874  uint8_t address ;
15875  } AddressedModeInit ;
15877 // *****************************************************************************
15878 /* USART Driver Errors.
15879  Summary:
15880  Defines the possible errors that can occur during driver operation.
15881  Description:
15882  This data type defines the possible errors that can occur when occur during
15883  USART driver operation. These values are returned by DRV_USART_ErrorGet
15884  function.
15885  Remarks:
15886  None
15887 */
15888 
15889 typedef
15890  enum
15891  {
15892  /* There was no error */
15894  /*DOM-IGNORE-BEGIN*/
15895  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15896  ,
15897  /* This indicates that a parity error has occurred */
15899  /*DOM-IGNORE-BEGIN*/
15900  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15901  ,
15902  /* This indicates that a framing error has occurred */
15904  /*DOM-IGNORE-BEGIN*/
15905  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15906  ,
15907  /* This indicates a receiver overflow has occurred */
15909  /*DOM-IGNORE-BEGIN*/
15910  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15911  ,
15912  /* Channel address error (Applicable in DMA mode) */
15913  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15914  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15915  } DRV_USART_ERROR ;
15916 // *****************************************************************************
15917 /* USART Client-Specific Driver Status
15918  Summary:
15919  Defines the client-specific status of the USART driver.
15920  Description:
15921  This enumeration defines the client-specific status codes of the USART
15922  driver.
15923  Remarks:
15924  Returned by the DRV_USART_ClientStatus function.
15925 */
15926 
15927 typedef
15928  enum
15929  {
15930  /* An error has occurred.*/
15932  /* The driver is closed, no operations for this client are ongoing,
15933  and/or the given handle is invalid. */
15935  /* The driver is currently busy and cannot start additional operations. */
15937  /* The module is running and ready for additional operations */
15940 // *****************************************************************************
15941 /* USART Driver Transfer Flags
15942  Summary
15943  Specifies the status of the receive or transmit
15944  Description
15945  This type specifies the status of the receive or transmit operation.
15946  Remarks:
15947  More than one of these values may be OR'd together to create a complete
15948  status value. To test a value of this type, the bit of interest must be
15949  ANDed with the value and checked to see if the result is non-zero.
15950 */
15951 
15952 typedef
15953  enum
15954  {
15955  /* Indicates that at least one byte of Data has been received */
15957  /*DOM-IGNORE-BEGIN*/
15958  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15959  ,
15960  /* Indicates that the core driver receiver buffer is empty */
15962  /*DOM-IGNORE-BEGIN*/
15963  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15964  ,
15965  /* Indicates that the core driver transmitter buffer is full */
15967  /*DOM-IGNORE-BEGIN*/
15968  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15969  ,
15970  /* Indicates that the core driver transmitter buffer is empty */
15972  /*DOM-IGNORE-BEGIN*/
15973  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15975 // *****************************************************************************
15976 /* USART Driver Initialization Data
15977  Summary:
15978  Defines the data required to initialize or reinitialize the USART driver
15979  Description:
15980  This data type defines the data required to initialize or reinitialize the
15981  USART driver. If the driver is built statically, the members of this data
15982  structure are statically over-ridden by static override definitions in the
15983  system_config.h file.
15984  Remarks:
15985  None.
15986 */
15987 
15988 typedef
15989  struct
15990  {
15991  /* System module initialization data */
15992  SYS_MODULE_INIT moduleInit ;
15993  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15994  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15995  system_config.h header file. */
15996  USART_MODULE_ID usartID ;
15997  /* Identifies the Operation mode of the USART driver. For a static build of
15998  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15999  system_config.h header file. */
16001  /* Data required by the operation mode of the driver. For a static build of
16002  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
16003  system_config.h header file. */
16005  /* Flags to enable specific features. Refer to the
16006  description of DRV_USART_INIT_FLAGS for more details. For a static build
16007  of the driver, this is overridden by DRV_USART_FLAGS macro in the
16008  system_config.h header file. */
16009  DRV_USART_INIT_FLAGS flags ;
16010  /* USART module Baud Rate Generator Clock. This typically
16011  the peripheral bus clock frequency. For a static build of the driver,
16012  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
16013  header file. */
16014  uint32_t brgClock ;
16015  /* The initial USART line control settings. For a static build of the driver
16016  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
16017  system_config.h header file. */
16018  DRV_USART_LINE_CONTROL lineControl ;
16019  /* Baud Rate value to be used, if not using auto baud. For a static build of
16020  the driver, this is overridden by the DRV_USART_BAUD macro in the
16021  system_config.h header file. */
16022  uint32_t baud ;
16023  /* Handshaking mode. For a static build of the driver, this is overridden by
16024  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
16025  DRV_USART_HANDSHAKE handshake ;
16026  /* Lines enabled for the USART operation. For a static build of the driver,
16027  this is overridden by the DRV_USART_LINES_ENABLE macro in
16028  the system_config.h header file.
16029  For PPS parts, pin selection in ports overrides this. */
16030  USART_OPERATION_MODE linesEnable ;
16031  /* Interrupt source ID for the transmitter interrupt. For a static build of
16032  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
16033  macro in the system_config.h header. */
16034  INT_SOURCE interruptTransmit ;
16035  /* Interrupt source ID for the receiver interrupt. For a static build of
16036  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
16037  macro in the system_config.h header. */
16038  INT_SOURCE interruptReceive ;
16039  /* Interrupt source ID for the error Interrupt. For a static build of the
16040  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
16041  in the system_config.h header. */
16042  INT_SOURCE interruptError ;
16043  /* This is the receive buffer queue size. This is the maximum
16044  number of read requests that driver will queue. For a
16045  static build of the driver, this is overridden by the
16046  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
16047  unsigned int queueSizeReceive ;
16048  /* This is the transmit buffer queue size. This is the maximum
16049  number of write requests that driver will queue. For a
16050  static build of the driver, this is overridden by the
16051  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
16052  unsigned int queueSizeTransmit ;
16053  /* This is the USART transmit DMA channel.
16054  For a static build of the driver, this is overridden by the
16055  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
16056  DMA_CHANNEL dmaChannelTransmit ;
16057  /* This is the USART receive DMA channel.
16058  For a static build of the driver, this is overridden by the
16059  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
16060  DMA_CHANNEL dmaChannelReceive ;
16061  /* This is the USART transmit DMA channel interrupt.
16062  For a static build of the driver, this is overridden by the
16063  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
16064  INT_SOURCE dmaInterruptTransmit ;
16065  /* This is the USART receive DMA channel interrupt.
16066  For a static build of the driver, this is overridden by the
16067  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
16068  INT_SOURCE dmaInterruptReceive ;
16069  } DRV_USART_INIT ;
16070 //DOM-IGNORE-BEGIN
16071 //DOM-IGNORE-END
16072  // #ifndef _DRV_USART_DEFINITIONS_H
16073 /*******************************************************************************
16074  End of File
16075 */
16076 
16077 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
16078 /* CLOSE_FILE Include File */
16079 
16080 // DOM-IGNORE-BEGIN
16081 // DOM-IGNORE-END
16082 // *****************************************************************************
16083 // *****************************************************************************
16084 // Section: USART Driver Module Interface Routines
16085 // *****************************************************************************
16086 // *****************************************************************************
16087 // *****************************************************************************
16088 /* Function:
16089  SYS_MODULE_OBJ DRV_USART_Initialize
16090  (
16091  const SYS_MODULE_INDEX index,
16092  const SYS_MODULE_INIT * const init
16093  )
16094  Summary:
16095  Initializes the USART instance for the specified driver index.
16096  <p><b>Implementation:</b> Static/Dynamic</p>
16097  Description:
16098  This routine initializes the USART driver instance for the specified driver
16099  index, making it ready for clients to open and use it. The initialization
16100  data is specified by the init parameter. The initialization may fail if the
16101  number of driver objects allocated are insufficient or if the specified
16102  driver instance is already initialized. The driver instance index is
16103  independent of the USART module ID. For example, driver instance 0 can be
16104  assigned to USART2. If the driver is built statically, then some of the
16105  initialization parameters are overridden by configuration macros. Refer to
16106  the description of the DRV_USART_INIT data structure for more details on
16107  which members on this data structure are overridden.
16108  Precondition:
16109  None.
16110  Parameters:
16111  index - Identifier for the instance to be initialized
16112  init - Pointer to a data structure containing any data necessary to
16113  initialize the driver.
16114  Returns:
16115  If successful, returns a valid handle to a driver instance object.
16116  Otherwise, returns SYS_MODULE_OBJ_INVALID.
16117  Example:
16118  <code>
16119  // The following code snippet shows an example USART driver initialization.
16120  // The driver is initialized for normal mode and a baud of 300. The
16121  // receive queue size is set to 2 and transmit queue size is set to 3.
16122  DRV_USART_INIT usartInit;
16123  SYS_MODULE_OBJ objectHandle;
16124  usartInit.baud = 300;
16125  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
16126  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
16127  usartInit.usartID = USART_ID_2;
16128  usartInit.brgClock = 80000000;
16129  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
16130  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
16131  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
16132  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
16133  usartInit.queueSizeReceive = 2;
16134  usartInit.queueSizeTransmit = 3;
16135  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
16136  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
16137  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
16138  if (SYS_MODULE_OBJ_INVALID == objectHandle)
16139  {
16140  // Handle error
16141  }
16142  </code>
16143  Remarks:
16144  This routine must be called before any other USART routine is called.
16145  This routine should only be called once during system initialization
16146  unless DRV_USART_Deinitialize is called to deinitialize the driver
16147  instance. This routine will NEVER block for hardware access.
16148 */
16149 
16150 SYS_MODULE_OBJ
16152  const SYS_MODULE_INDEX index ,
16153  const SYS_MODULE_INIT * const init ) ;
16154 // *****************************************************************************
16155 /* Function:
16156  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
16157  Summary:
16158  Deinitializes the specified instance of the USART driver module.
16159  <p><b>Implementation:</b> Static/Dynamic</p>
16160  Description:
16161  Deinitializes the specified instance of the USART driver module, disabling
16162  its operation (and any hardware). Invalidates all the internal data.
16163  Precondition:
16164  Function DRV_USART_Initialize should have been called before calling this
16165  function.
16166  Parameters:
16167  object - Driver object handle, returned from the
16168  DRV_USART_Initialize routine
16169  Returns:
16170  None.
16171  Example:
16172  <code>
16173  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16174  SYS_STATUS status;
16175  DRV_USART_Deinitialize(object);
16176  status = DRV_USART_Status(object);
16177  if (SYS_MODULE_DEINITIALIZED != status)
16178  {
16179  // Check again later if you need to know
16180  // when the driver is deinitialized.
16181  }
16182  </code>
16183  Remarks:
16184  Once the Initialize operation has been called, the Deinitialize operation
16185  must be called before the Initialize operation can be called again. This
16186  routine will NEVER block waiting for hardware.
16187 */
16188 
16189 void
16191  SYS_MODULE_OBJ object ) ;
16192 // *****************************************************************************
16193 /* Function:
16194  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
16195  Summary:
16196  Gets the current status of the USART driver module.
16197  <p><b>Implementation:</b> Static/Dynamic</p>
16198  Description:
16199  This routine provides the current status of the USART driver module.
16200  Precondition:
16201  Function DRV_USART_Initialize should have been called before calling this
16202  function.
16203  Parameters:
16204  object - Driver object handle, returned from the
16205  DRV_USART_Initialize routine
16206  Returns:
16207  SYS_STATUS_READY - Indicates that the driver is busy with a
16208  previous system level operation and cannot start
16209  another
16210  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
16211  deinitialized
16212  Example:
16213  <code>
16214  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16215  SYS_STATUS usartStatus;
16216  usartStatus = DRV_USART _Status(object);
16217  if (SYS_STATUS_READY == usartStatus)
16218  {
16219  // This means the driver can be opened using the
16220  // DRV_USART_Open() function.
16221  }
16222  </code>
16223  Remarks:
16224  A driver can opened only when its status is SYS_STATUS_READY.
16225 */
16226 
16227 SYS_STATUS
16229  SYS_MODULE_OBJ object ) ;
16230 // *****************************************************************************
16231 /* Function:
16232  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
16233  Summary:
16234  Maintains the driver's transmit state machine and implements its ISR.
16235  <p><b>Implementation:</b> Static/Dynamic</p>
16236  Description:
16237  This routine is used to maintain the driver's internal transmit state
16238  machine and implement its transmit ISR for interrupt-driven implementations.
16239  In polling mode, this function should be called from the SYS_Tasks
16240  function. In interrupt mode, this function should be called in the transmit
16241  interrupt service routine of the USART that is associated with this USART
16242  driver hardware instance.
16243  Precondition:
16244  The DRV_USART_Initialize routine must have been called for the specified
16245  USART driver instance.
16246  Parameters:
16247  object - Object handle for the specified driver instance (returned from
16248  DRV_USART_Initialize)
16249  Returns:
16250  None.
16251  Example:
16252  <code>
16253  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16254  while (true)
16255  {
16256  DRV_USART_TasksTransmit (object);
16257  // Do other tasks
16258  }
16259  </code>
16260  Remarks:
16261  This routine is normally not called directly by an application. It is
16262  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16263  ISR.
16264  This routine may execute in an ISR context and will never block or access any
16265  resources that may cause it to block.
16266 */
16267 
16268 void
16270  SYS_MODULE_OBJ object ) ;
16271 // *****************************************************************************
16272 /* Function:
16273  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
16274  Summary:
16275  Maintains the driver's receive state machine and implements its ISR.
16276  <p><b>Implementation:</b> Static/Dynamic</p>
16277  Description:
16278  This routine is used to maintain the driver's internal receive state machine
16279  and implement its receive ISR for interrupt-driven implementations. In
16280  polling mode, this function should be called from the SYS_Tasks function.
16281  In interrupt mode, this function should be called in the receive interrupt
16282  service routine of the USART that is associated with this USART driver
16283  hardware instance.
16284  Precondition:
16285  The DRV_USART_Initialize routine must have been called for the specified
16286  USART driver instance.
16287  Parameters:
16288  object - Object handle for the specified driver instance (returned from
16289  DRV_USART_Initialize)
16290  Returns:
16291  None.
16292  Example:
16293  <code>
16294  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16295  while (true)
16296  {
16297  DRV_USART_TasksReceive (object);
16298  // Do other tasks
16299  }
16300  </code>
16301  Remarks:
16302  This routine is normally not called directly by an application. It is
16303  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16304  ISR.
16305  This routine may execute in an ISR context and will never block or access any
16306  resources that may cause it to block.
16307 */
16308 
16309 void
16311  SYS_MODULE_OBJ object ) ;
16312 // *****************************************************************************
16313 /* Function:
16314  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
16315  Summary:
16316  Maintains the driver's error state machine and implements its ISR.
16317  <p><b>Implementation:</b> Static/Dynamic</p>
16318  Description:
16319  This routine is used to maintain the driver's internal error state machine
16320  and implement its error ISR for interrupt-driven implementations. In
16321  polling mode, this function should be called from the SYS_Tasks function.
16322  In interrupt mode, this function should be called in the error interrupt
16323  service routine of the USART that is associated with this USART driver
16324  hardware instance.
16325  Precondition:
16326  The DRV_USART_Initialize routine must have been called for the specified
16327  USART driver instance.
16328  Parameters:
16329  object - Object handle for the specified driver instance (returned from
16330  DRV_USART_Initialize)
16331  Returns:
16332  None.
16333  Example:
16334  <code>
16335  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16336  while (true)
16337  {
16338  DRV_USART_TasksError (object);
16339  // Do other tasks
16340  }
16341  </code>
16342  Remarks:
16343  This routine is normally not called directly by an application. It is
16344  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16345  ISR.
16346  This routine may execute in an ISR context and will never block or access any
16347  resources that may cause it to block.
16348 */
16349 
16350 void
16352  SYS_MODULE_OBJ object ) ;
16353 // *****************************************************************************
16354 // *****************************************************************************
16355 // Section: USART Driver Client Routines
16356 // *****************************************************************************
16357 // *****************************************************************************
16358 // *****************************************************************************
16359 /* Function:
16360  DRV_HANDLE DRV_USART_Open
16361  (
16362  const SYS_MODULE_INDEX index,
16363  const DRV_IO_INTENT ioIntent
16364  )
16365  Summary:
16366  Opens the specified USART driver instance and returns a handle to it.
16367  <p><b>Implementation:</b> Static/Dynamic</p>
16368  Description:
16369  This routine opens the specified USART driver instance and provides a
16370  handle that must be provided to all other client-level operations to
16371  identify the caller and the instance of the driver. The ioIntent
16372  parameter defines how the client interacts with this driver instance.
16373  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
16374  additionally affect the behavior of the DRV_USART_Read and
16375  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
16376  then these function will not block even if the required amount of data could
16377  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
16378  will block until the required amount of data is processed. If the driver is
16379  configured for polling and bare-metal operation, it will not support
16380  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
16381  non-blocking.
16382  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
16383  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
16384  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
16385  client will be able to do both, read and write.
16386  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
16387  exclusive access to this client. The driver cannot be opened by any
16388  other client.
16389  Precondition:
16390  Function DRV_USART_Initialize must have been called before calling this
16391  function.
16392  Parameters:
16393  index - Identifier for the object instance to be opened
16394  intent - Zero or more of the values from the enumeration
16395  DRV_IO_INTENT "ORed" together to indicate the intended use
16396  of the driver. See function description for details.
16397  Returns:
16398  If successful, the routine returns a valid open-instance handle (a number
16399  identifying both the caller and the module instance).
16400  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
16401  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
16402  insufficient.
16403  - if the client is trying to open the driver but driver has been opened
16404  exclusively by another client.
16405  - if the driver hardware instance being opened is not initialized or is
16406  invalid.
16407  - if the client is trying to open the driver exclusively, but has already
16408  been opened in a non exclusive mode by another client.
16409  - if the driver is not ready to be opened, typically when the initialize
16410  routine has not completed execution.
16411  Example:
16412  <code>
16413  DRV_HANDLE handle;
16414  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
16415  if (DRV_HANDLE_INVALID == handle)
16416  {
16417  // Unable to open the driver
16418  // May be the driver is not initialized or the initialization
16419  // is not complete.
16420  }
16421  </code>
16422  Remarks:
16423  The handle returned is valid until the DRV_USART_Close routine is called.
16424  This routine will NEVER block waiting for hardware.If the requested intent
16425  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
16426  function is thread safe in a RTOS application.
16427 */
16428 
16429 DRV_HANDLE
16430  DRV_USART_Open (
16431  const SYS_MODULE_INDEX index ,
16432  const DRV_IO_INTENT ioIntent ) ;
16433 // *****************************************************************************
16434 /* Function:
16435  void DRV_USART_Close( DRV_Handle handle )
16436  Summary:
16437  Closes an opened-instance of the USART driver.
16438  <p><b>Implementation:</b> Static/Dynamic</p>
16439  Description:
16440  This routine closes an opened-instance of the USART driver, invalidating the
16441  handle. Any buffers in the driver queue that were submitted by this client
16442  will be removed. After calling this routine, the handle passed in "handle"
16443  must not be used with any of the remaining driver routines (with one
16444  possible exception described in the "Remarks" section). A new handle must
16445  be obtained by calling DRV_USART_Open before the caller may use the driver
16446  again
16447  Precondition:
16448  The DRV_USART_Initialize routine must have been called for the specified
16449  USART driver instance.
16450  DRV_USART_Open must have been called to obtain a valid opened device handle.
16451  Parameters:
16452  handle - A valid open-instance handle, returned from the driver's
16453  open routine
16454  Returns:
16455  None.
16456  Example:
16457  <code>
16458  DRV_HANDLE handle; // Returned from DRV_USART_Open
16459  DRV_USART_Close(handle);
16460  // After this point, the handle cannot be used with any other function
16461  // except the DRV_USART_ClientStatus function, which can be used to query
16462  // the success status of the DRV_USART_Close function.
16463  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
16464  </code>
16465  Remarks:
16466  Usually there is no need for the client to verify that the Close operation
16467  has completed. The driver will abort any ongoing operations when this
16468  routine is called. However, if it requires additional time to do so in a
16469  non-blocking environment, it will still return from the Close operation but
16470  the handle is now a zombie handle. The client can only call the
16471  DRV_USART_ClientStatus on a zombie handle to track the completion of the
16472  Close operation. The DRV_USART_ClientStatus routine will return
16473  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
16474 */
16475 
16476 void
16477  DRV_USART_Close (
16478  const DRV_HANDLE handle ) ;
16479 // *****************************************************************************
16480 /*
16481  Function:
16482  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
16483  Summary:
16484  Gets the current client-specific status the USART driver.
16485  <p><b>Implementation:</b> Static/Dynamic</p>
16486  Description:
16487  This function gets the client-specific status of the USART driver associated
16488  with the given handle. This function can be used to check the status of
16489  client after the DRV_USART_Close() function has been called.
16490  Preconditions:
16491  The DRV_USART_Initialize function must have been called.
16492  DRV_USART_Open must have been called to obtain a valid opened device
16493  handle.
16494  Parameters:
16495  handle - Handle returned from the driver's open function.
16496  Returns:
16497  A DRV_USART_CLIENT_STATUS value describing the current status of the
16498  driver.
16499  Example:
16500  <code>
16501  DRV_HANDLE handle; // Returned from DRV_USART_Open
16502  DRV_USART_CLIENT_STATUS status;
16503  status = DRV_USART_ClientStatus(handle);
16504  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
16505  {
16506  // The client had not closed.
16507  }
16508  </code>
16509  Remarks:
16510  This function will not block for hardware access and will immediately return
16511  the current status. This function is thread safe when called in a RTOS
16512  application.
16513 */
16514 
16517  DRV_HANDLE handle ) ;
16518 // *****************************************************************************
16519 // *****************************************************************************
16520 // Section: USART Driver Buffer Queuing Model Interface Routines
16521 // *****************************************************************************
16522 // *****************************************************************************
16523 // *****************************************************************************
16524 /* Function:
16525  void DRV_USART_BufferAddWrite
16526  (
16527  const DRV_HANDLE handle,
16528  DRV_USART_BUFFER_HANDLE * bufferHandle,
16529  void * buffer,
16530  size_t size
16531  );
16532  Summary:
16533  Schedule a non-blocking driver write operation.
16534  <p><b>Implementation:</b> Static/Dynamic</p>
16535  Description:
16536  This function schedules a non-blocking write operation. The function returns
16537  with a valid buffer handle in the bufferHandle argument if the write request
16538  was scheduled successfully. The function adds the request to the hardware
16539  instance transmit queue and returns immediately. While the request is in the
16540  queue, the application buffer is owned by the driver and should not be
16541  modified. On returning, the bufferHandle parameter may be
16542  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16543  - if a buffer could not be allocated to the request
16544  - if the input buffer pointer is NULL
16545  - if the client opened the driver for read-only
16546  - if the buffer size is 0
16547  - if the transmit queue is full or the queue depth is insufficient
16548  If the requesting client registered an event callback with the driver, the
16549  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16550  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16551  was not processed successfully.
16552  Precondition:
16553  The DRV_USART_Initialize routine must have been called for the specified
16554  USART device instance and the DRV_USART_Status must have returned
16555  SYS_STATUS_READY.
16556  DRV_USART_Open must have been called to obtain a valid opened device handle.
16557  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16558  the DRV_USART_Open call.
16559  Parameters:
16560  handle - Handle of the communication channel as return by the
16561  DRV_USART_Open function.
16562  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16563  buffer - Data to be transmitted.
16564  size - Buffer size in bytes.
16565  Returns:
16566  The bufferHandle parameter will contain the return buffer handle. This will be
16567  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16568  Example:
16569  <code>
16570  MY_APP_OBJ myAppObj;
16571  uint8_t mybuffer[MY_BUFFER_SIZE];
16572  DRV_USART_BUFFER_HANDLE bufferHandle;
16573  // myUSARTHandle is the handle returned
16574  // by the DRV_USART_Open function.
16575  // Client registers an event handler with driver
16576  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16577  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16578  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16579  myBuffer, MY_BUFFER_SIZE);
16580  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16581  {
16582  // Error handling here
16583  }
16584  // Event is received when
16585  // the buffer is processed.
16586  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16587  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16588  {
16589  // contextHandle points to myAppObj.
16590  switch(event)
16591  {
16592  case DRV_USART_BUFFER_EVENT_COMPLETE:
16593  // This means the data was transferred.
16594  break;
16595  case DRV_USART_BUFFER_EVENT_ERROR:
16596  // Error handling here.
16597  break;
16598  default:
16599  break;
16600  }
16601  }
16602  </code>
16603  Remarks:
16604  This function is thread safe in a RTOS application. It can be called from
16605  within the USART Driver Buffer Event Handler that is registered by this
16606  client. It should not be called in the event handler associated with another
16607  USART driver instance. It should not otherwise be called directly in an ISR.
16608 */
16609 
16610 void
16612  const DRV_HANDLE handle ,
16613  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16614  void * buffer ,
16615  const size_t size ) ;
16616 // *****************************************************************************
16617 /* Function:
16618  void DRV_USART_AddressedBufferAddWrite
16619  (
16620  const DRV_HANDLE hClient,
16621  DRV_USART_BUFFER_HANDLE * bufferHandle,
16622  uint8_t address,
16623  void * source,
16624  size_t nWords
16625  );
16626  Summary:
16627  Schedule a non-blocking addressed driver write operation.
16628  <p><b>Implementation:</b> Dynamic</p>
16629  Description:
16630  This function schedules a non-blocking addressed write operation. The function returns
16631  with a valid buffer handle in the bufferHandle argument if the addressed write request
16632  was scheduled successfully. The function adds the request to the hardware
16633  instance transmit queue and returns immediately. While the request is in the
16634  queue, the application buffer is owned by the driver and should not be
16635  modified. On returning, the bufferHandle parameter may be
16636  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16637  - if a buffer could not be allocated to the request
16638  - if the input buffer pointer is NULL
16639  - if the client opened the driver for read-only
16640  - if the buffer size is 0
16641  - if the transmit queue is full or the queue depth is insufficient
16642  If the requesting client registered an event callback with the driver, the
16643  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16644  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16645  was not processed successfully.
16646  Precondition:
16647  The DRV_USART_Initialize routine must have been called for the specified
16648  USART device instance and the DRV_USART_Status must have returned
16649  SYS_STATUS_READY.
16650  DRV_USART_Open must have been called to obtain a valid opened device handle.
16651  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16652  the DRV_USART_Open call.
16653  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16654  Parameters:
16655  hClient - Handle of the communication channel as return by the
16656  DRV_USART_Open function.
16657  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16658  address - Address of the receiver client
16659  source - Data to be transmitted.
16660  size - Buffer size in 16-bit words.
16661  Returns:
16662  The bufferHandle parameter will contain the return buffer handle. This will be
16663  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16664  Example:
16665  <code>
16666  MY_APP_OBJ myAppObj;
16667  uint16_t mybuffer[MY_BUFFER_SIZE];
16668  DRV_USART_BUFFER_HANDLE bufferHandle;
16669  uint8_t clientAddress;
16670  // myUSARTHandle is the handle returned
16671  // by the DRV_USART_Open function.
16672  // Client registers an event handler with driver
16673  clientAddress = 0x60;
16674  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16675  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16676  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16677  myBuffer, MY_BUFFER_SIZE);
16678  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16679  {
16680  // Error handling here
16681  }
16682  // Event is received when
16683  // the buffer is processed.
16684  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16685  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16686  {
16687  // contextHandle points to myAppObj.
16688  switch(event)
16689  {
16690  case DRV_USART_BUFFER_EVENT_COMPLETE:
16691  // This means the data was transferred.
16692  break;
16693  case DRV_USART_BUFFER_EVENT_ERROR:
16694  // Error handling here.
16695  break;
16696  default:
16697  break;
16698  }
16699  }
16700  </code>
16701  Remarks:
16702  This function is thread safe in a RTOS application. It can be called from
16703  within the USART Driver Buffer Event Handler that is registered by this
16704  client. It should not be called in the event handler associated with another
16705  USART driver instance. It should not otherwise be called directly in an ISR.
16706  The source buffer should be a 16-bit word aligned buffer.
16707  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16708 */
16709 
16710 void
16712  const DRV_HANDLE hClient ,
16713  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16714  uint8_t address ,
16715  void * source ,
16716  size_t nWords ) ;
16717 // *****************************************************************************
16718 /* Function:
16719  void DRV_USART_BufferAddRead
16720  (
16721  const DRV_HANDLE handle,
16722  DRV_USART_BUFFER_HANDLE * bufferHandle,
16723  void * buffer,
16724  const size_t size
16725  )
16726  Summary:
16727  Schedule a non-blocking driver read operation.
16728  <p><b>Implementation:</b> Static/Dynamic</p>
16729  Description:
16730  This function schedules a non-blocking read operation. The function returns
16731  with a valid buffer handle in the bufferHandle argument if the read request
16732  was scheduled successfully. The function adds the request to the hardware
16733  instance receive queue and returns immediately. While the request is in the
16734  queue, the application buffer is owned by the driver and should not be
16735  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16736  bufferHandle argument:
16737  - if a buffer could not be allocated to the request
16738  - if the input buffer pointer is NULL
16739  - if the buffer size is 0
16740  - if the read queue size is full or queue depth is insufficient.
16741  - if the driver handle is invalid
16742  If the requesting client registered an event callback with the driver, the
16743  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16744  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16745  was not processed successfully.
16746  Precondition:
16747  The DRV_USART_Initialize routine must have been called for the specified
16748  USART device instance and the DRV_USART_Status must have returned
16749  SYS_STATUS_READY.
16750  DRV_USART_Open must have been called to obtain a valid opened device handle.
16751  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16752  the DRV_USART_Open call.
16753  Parameters:
16754  handle - Handle of the communication channel as returned by the
16755  DRV_USART_Open function.
16756  buffer - Buffer where the received data will be stored.
16757  size - Buffer size in bytes.
16758  Returns:
16759  The buffer handle is returned in the bufferHandle argument. This is
16760  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16761  Example:
16762  <code>
16763  MY_APP_OBJ myAppObj;
16764  uint8_t mybuffer[MY_BUFFER_SIZE];
16765  DRV_USART_BUFFER_HANDLE bufferHandle;
16766  // myUSARTHandle is the handle returned
16767  // by the DRV_USART_Open function.
16768  // Client registers an event handler with driver
16769  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16770  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16771  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16772  myBuffer, MY_BUFFER_SIZE);
16773  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16774  {
16775  // Error handling here
16776  }
16777  // Event is received when
16778  // the buffer is processed.
16779  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16780  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16781  {
16782  // contextHandle points to myAppObj.
16783  switch(event)
16784  {
16785  case DRV_USART_BUFFER_EVENT_COMPLETE:
16786  // This means the data was transferred.
16787  break;
16788  case DRV_USART_BUFFER_EVENT_ERROR:
16789  // Error handling here.
16790  break;
16791  default:
16792  break;
16793  }
16794  }
16795  </code>
16796  Remarks:
16797  This function is thread safe in a RTOS application. It can be called from
16798  within the USART Driver Buffer Event Handler that is registered by the
16799  client. It should not be called in the event handler associated with another
16800  USART driver instance. It should not be called directly in an ISR.
16801 */
16802 
16803 void
16805  const DRV_HANDLE handle ,
16806  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16807  void * buffer ,
16808  const size_t size ) ;
16809 // *****************************************************************************
16810 /* Function:
16811  void DRV_USART_BufferEventHandlerSet
16812  (
16813  const DRV_HANDLE handle,
16814  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16815  const uintptr_t context
16816  )
16817  Summary:
16818  Allows a client to identify a buffer event handling function for the driver
16819  to call back when queued buffer transfers have finished.
16820  <p><b>Implementation:</b> Static/Dynamic</p>
16821  Description:
16822  This function allows a client to identify a buffer event handling function
16823  for the driver to call back when queued buffer transfers have finished.
16824  When a client calls either the DRV_USART_BufferAddRead or
16825  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16826  the buffer that was added to the driver's buffer queue. The driver will
16827  pass this handle back to the client by calling "eventHandler" function when
16828  the buffer transfer has completed.
16829  The event handler should be set before the client performs any "buffer add"
16830  operations that could generate events. The event handler once set, persists
16831  until the client closes the driver or sets another event handler (which
16832  could be a "NULL" pointer to indicate no callback).
16833  Precondition:
16834  The DRV_USART_Initialize routine must have been called for the specified
16835  USART driver instance.
16836  DRV_USART_Open must have been called to obtain a valid opened device handle.
16837  Parameters:
16838  handle - A valid open-instance handle, returned from the driver's
16839  open routine
16840  eventHandler - Pointer to the event handler function.
16841  context - The value of parameter will be passed back to the client
16842  unchanged, when the eventHandler function is called. It can
16843  be used to identify any client specific data object that
16844  identifies the instance of the client module (for example,
16845  it may be a pointer to the client module's state structure).
16846  Returns:
16847  None.
16848  Example:
16849  <code>
16850  // myAppObj is an application specific state data object.
16851  MY_APP_OBJ myAppObj;
16852  uint8_t mybuffer[MY_BUFFER_SIZE];
16853  DRV_USART_BUFFER_HANDLE bufferHandle;
16854  // myUSARTHandle is the handle returned
16855  // by the DRV_USART_Open function.
16856  // Client registers an event handler with driver. This is done once
16857  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16858  (uintptr_t)&myAppObj );
16859  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16860  myBuffer, MY_BUFFER_SIZE);
16861  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16862  {
16863  // Error handling here
16864  }
16865  // Event Processing Technique. Event is received when
16866  // the buffer is processed.
16867  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16868  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16869  {
16870  // The context handle was set to an application specific
16871  // object. It is now retrievable easily in the event handler.
16872  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16873  switch(event)
16874  {
16875  case DRV_USART_BUFFER_EVENT_COMPLETE:
16876  // This means the data was transferred.
16877  break;
16878  case DRV_USART_BUFFER_EVENT_ERROR:
16879  // Error handling here.
16880  break;
16881  default:
16882  break;
16883  }
16884  }
16885  </code>
16886  Remarks:
16887  If the client does not want to be notified when the queued buffer transfer
16888  has completed, it does not need to register a callback. This function is
16889  thread safe when called in a RTOS application.
16890 */
16891 
16892 void
16894  const DRV_HANDLE handle ,
16895  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16896  const uintptr_t context ) ;
16897 // *****************************************************************************
16898 /* Function:
16899  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16900  Summary:
16901  Removes a requested buffer from the queue.
16902  <p><b>Implementation:</b> Static/Dynamic</p>
16903  Description:
16904  This function removes a specified buffer from the queue.
16905  The client can use this function to delete
16906  1. An unwated stalled buffer.
16907  2. Queued buffers on timeout.
16908  or in any other use case.
16909  Precondition:
16910  The DRV_USART_Initialize routine must have been called for the specified
16911  USART driver instance.
16912  DRV_USART_Open must have been called to obtain a valid opened device handle.
16913  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16914  must have been called and a valid buffer handle returned.
16915  Parameters:
16916  bufferhandle - Handle of the buffer to delete.
16917  Returns:
16918  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16919  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16920  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16921  queue successfully.
16922  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16923  the queue because of mutex timeout in RTOS environment.
16924  Example:
16925  <code>
16926  // myAppObj is an application specific object.
16927  MY_APP_OBJ myAppObj;
16928  uint8_t mybuffer[MY_BUFFER_SIZE];
16929  DRV_USART_BUFFER_HANDLE bufferHandle;
16930  // myUSARTHandle is the handle returned
16931  // by the DRV_USART_Open function.
16932  // Client registers an event handler with driver. This is done once
16933  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16934  (uintptr_t)&myAppObj );
16935  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16936  myBuffer, MY_BUFFER_SIZE );
16937  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16938  {
16939  // Error handling here
16940  }
16941  // Event Processing Technique. Event is received when
16942  // the buffer is processed.
16943  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16944  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16945  {
16946  switch(event)
16947  {
16948  case DRV_USART_BUFFER_EVENT_COMPLETE:
16949  // This means the data was transferred.
16950  break;
16951  case DRV_USART_BUFFER_EVENT_ERROR:
16952  // Error handling here.
16953  break;
16954  default:
16955  break;
16956  }
16957  }
16958  // Timeout function, where remove queued buffer if it still exists.
16959  void APP_TimeOut(void)
16960  {
16961  DRV_USART_BUFFER_RESULT bufferResult;
16962  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16963  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16964  {
16965  //Buffer removed succesfully from the queue
16966  }
16967  else
16968  {
16969  //Either buffer is invalid or expired.
16970  //Or not able to acquire mutex in RTOS mode.
16971  }
16972  }
16973  </code>
16974  Remarks:
16975  This function is thread safe when used in a RTOS application.
16976 */
16977 
16980  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16981 // *****************************************************************************
16982 /* Function:
16983  size_t DRV_USART_BufferCompletedBytesGet
16984  (
16985  DRV_USART_BUFFER_HANDLE bufferHandle
16986  );
16987  Summary:
16988  Returns the number of bytes that have been processed for the
16989  specified buffer.
16990  <p><b>Implementation:</b> Static/Dynamic</p>
16991  Description:
16992  This function returns number of bytes that have been processed for the
16993  specified buffer. The client can use this function, in a case where the
16994  buffer has terminated due to an error, to obtain the number of bytes that
16995  have been processed. Or in any other use case.
16996  This function can be used for non-DMA buffer transfers only. It cannot be
16997  used when the USART driver is configured to use DMA.
16998  Precondition:
16999  The DRV_USART_Initialize routine must have been called for the specified
17000  USART driver instance.
17001  DRV_USART_Open must have been called to obtain a valid opened device handle.
17002  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
17003  must have been called and a valid buffer handle returned.
17004  Parameters:
17005  bufferhandle - Handle for the buffer of which the processed number of bytes
17006  to be obtained.
17007  Returns:
17008  Returns the number of bytes that have been processed for this buffer.
17009  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
17010  buffer handle.
17011  Example:
17012  <code>
17013  // myAppObj is an application specific object.
17014  MY_APP_OBJ myAppObj;
17015  uint8_t mybuffer[MY_BUFFER_SIZE];
17016  DRV_USART_BUFFER_HANDLE bufferHandle;
17017  // myUSARTHandle is the handle returned
17018  // by the DRV_USART_Open function.
17019  // Client registers an event handler with driver. This is done once
17020  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17021  (uintptr_t)&myAppObj );
17022  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17023  myBuffer, MY_BUFFER_SIZE );
17024  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17025  {
17026  // Error handling here
17027  }
17028  // Event Processing Technique. Event is received when
17029  // the buffer is processed.
17030  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17031  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17032  {
17033  // The context handle was set to an application specific
17034  // object. It is now retrievable easily in the event handler.
17035  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17036  size_t processedBytes;
17037  switch(event)
17038  {
17039  case DRV_USART_BUFFER_EVENT_COMPLETE:
17040  // This means the data was transferred.
17041  break;
17042  case DRV_USART_BUFFER_EVENT_ERROR:
17043  // Error handling here.
17044  // We can find out how many bytes were processed in this
17045  // buffer before the error occurred.
17046  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17047  break;
17048  default:
17049  break;
17050  }
17051  }
17052  </code>
17053  Remarks:
17054  This function is thread safe when used in a RTOS application.
17055 */
17056 
17057 size_t
17059  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
17060 // *****************************************************************************
17061 /* Function:
17062  size_t DRV_USART_BufferProcessedSizeGet
17063  (
17064  DRV_USART_BUFFER_HANDLE bufferHandle
17065  );
17066  Summary:
17067  This API will be deprecated and not recommended to use.
17068  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
17069  processed for the specified buffer.
17070  Description:
17071  None.
17072  Precondition:
17073  None.
17074  Parameters:
17075  None.
17076  Returns:
17077  None.
17078  Example:
17079  None.
17080  Remarks:
17081  None.
17082 */
17083 
17084 size_t
17086  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
17087 // *****************************************************************************
17088 // *****************************************************************************
17089 // Section: USART Driver File System Model Routines
17090 // *****************************************************************************
17091 // *****************************************************************************
17092 // *****************************************************************************
17093 /* Function:
17094  size_t DRV_USART_Read
17095  (
17096  const DRV_HANDLE handle,
17097  void * buffer,
17098  const size_t numbytes
17099  )
17100  Summary:
17101  Reads data from the USART.
17102  <p><b>Implementation:</b> Static/Dynamic</p>
17103  Description:
17104  This routine reads data from the USART. This function is blocking if the
17105  driver was opened by the client for blocking operation. This function will
17106  not block if the driver was opened by the client for non blocking operation.
17107  If the ioIntent parameter at the time of opening the driver was
17108  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
17109  until) numbytes of bytes have been received or if an error occurred. If there
17110  are buffers queued for receiving data, these buffers will be serviced first. The
17111  function will not return until the requested number of bytes have been read.
17112  If the ioIntent parameter at the time of opening the driver was
17113  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
17114  bytes that were actually read. The function will not wait until numBytes of
17115  bytes have been read. If there are buffer queued for reading data, then the
17116  function will not block and will return immediately with 0 bytes read.
17117  Precondition:
17118  The DRV_USART_Initialize routine must have been called for the specified
17119  USART driver instance.
17120  DRV_USART_Open must have been called to obtain a valid opened device handle.
17121  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
17122  the DRV_USART_Open call.
17123  Parameters:
17124  handle - A valid open-instance handle, returned from the driver's
17125  open routine
17126  buffer - Buffer into which the data read from the USART instance
17127  will be placed.
17128  numbytes - Total number of bytes that need to be read from the module
17129  instance (must be equal to or less than the size of the
17130  buffer)
17131  Returns:
17132  Number of bytes actually copied into the caller's buffer. Returns
17133  DRV_USART_READ_ERROR in case of an error.
17134  Example:
17135  <code>
17136  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17137  char myBuffer[MY_BUFFER_SIZE];
17138  unsigned int count;
17139  unsigned int total;
17140  total = 0;
17141  do
17142  {
17143  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
17144  if(count == DRV_USART_READ_ERROR)
17145  {
17146  // There was an error. The DRV_USART_ErrorGet() function
17147  // can be called to find the exact error.
17148  }
17149  total += count;
17150  // Do something else...
17151  } while( total < MY_BUFFER_SIZE );
17152  </code>
17153  Remarks:
17154  This function is thread safe in a RTOS application. If the driver is
17155  configured for polled operation, this it will not support blocking operation
17156  in a bare metal (non-RTOS) application.
17157 */
17158 
17159 size_t
17160  DRV_USART_Read (
17161  const DRV_HANDLE handle ,
17162  void * buffer ,
17163  const size_t numbytes ) ;
17164 // *****************************************************************************
17165 /* Function:
17166  size_t DRV_USART_Write
17167  (
17168  const DRV_HANDLE handle,
17169  void * buffer,
17170  const size_t numbytes
17171  )
17172  Summary:
17173  Writes data to the USART.
17174  <p><b>Implementation:</b> Static/Dynamic</p>
17175  Description:
17176  This routine writes data to the USART. This function is blocking if the
17177  driver was opened by the client for blocking operation. This function will
17178  not block if the driver was opened by the client for non blocking operation.
17179  If the ioIntent parameter at the time of opening the driver was
17180  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
17181  until) numbytes of bytes have been transmitted or if an error occurred. If
17182  there are buffers queued for writing, the function will wait until all the
17183  preceding buffers are completed. Ongoing buffer transmit operations will not
17184  be affected.
17185  If the ioIntent parameter at the time of opening the driver was
17186  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
17187  bytes that were actually accepted for transmission. The function will not
17188  wait until numBytes of bytes have been transmitted. If there a buffers queued
17189  for transmit, the function will not wait and will return immediately with 0
17190  bytes.
17191  Precondition:
17192  The DRV_USART_Initialize routine must have been called for the specified
17193  USART driver instance.
17194  DRV_USART_Open must have been called to obtain a valid opened device handle.
17195  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
17196  the DRV_USART_Open call.
17197  Parameters:
17198  handle - A valid open-instance handle, returned from the driver's
17199  open routine
17200  buffer - Buffer containing the data to written.
17201  numbytes - size of the buffer
17202  Returns:
17203  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
17204  in case of an error.
17205  Example:
17206  <code>
17207  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17208  char myBuffer[MY_BUFFER_SIZE];
17209  int count;
17210  unsigned int total;
17211  total = 0;
17212  do
17213  {
17214  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
17215  MY_BUFFER_SIZE - total);
17216  total += count;
17217  // Do something else...
17218  } while( total < MY_BUFFER_SIZE );
17219  </code>
17220  Remarks:
17221  This function is thread safe in a RTOS application. This function is thread
17222  safe in a RTOS application. If the driver is configured for polled
17223  operation, this it will not support blocking operation in a bare metal (non-RTOS)
17224  application.
17225 */
17226 
17227 size_t
17228  DRV_USART_Write (
17229  const DRV_HANDLE handle ,
17230  void * buffer ,
17231  const size_t numbytes ) ;
17232 // *****************************************************************************
17233 /* Function:
17234  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
17235  Summary:
17236  Returns the transmitter and receiver transfer status.
17237  <p><b>Implementation:</b> Static/Dynamic</p>
17238  Description:
17239  This returns the transmitter and receiver transfer status.
17240  Precondition:
17241  The DRV_USART_Initialize routine must have been called for the specified
17242  USART driver instance.
17243  DRV_USART_Open must have been called to obtain a valid opened device handle.
17244  Parameters:
17245  handle - A valid open-instance handle, returned from the driver's
17246  open routine
17247  Returns:
17248  A DRV_USART_TRANSFER_STATUS value describing the current status
17249  of the transfer.
17250  Example:
17251  <code>
17252  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17253  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
17254  {
17255  // Data has been received that can be read
17256  }
17257  </code>
17258  Remarks:
17259  The returned status may contain a value with more than one of the bits
17260  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
17261  should perform an "AND" with the bit of interest and verify if the result is
17262  non-zero (as shown in the example) to verify the desired status bit. This
17263  function is thread safe when called in a RTOS application.
17264 */
17265 
17268  const DRV_HANDLE handle ) ;
17269 // *****************************************************************************
17270 // *****************************************************************************
17271 // Section: USART Driver Byte Model Routines
17272 // *****************************************************************************
17273 // *****************************************************************************
17274 // *****************************************************************************
17275 /* Function:
17276  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
17277  Summary:
17278  Reads a byte of data from the USART.
17279  <p><b>Implementation:</b> Static/Dynamic</p>
17280  Description:
17281  This routine reads a byte of data from the USART.
17282  Precondition:
17283  The DRV_USART_Initialize routine must have been called for the specified
17284  USART driver instance.
17285  DRV_USART_Open must have been called to obtain a valid opened device handle.
17286  The transfer status should be checked to see if the receiver is not empty
17287  before calling this function.
17288  Parameters:
17289  handle - A valid open-instance handle, returned from the driver's
17290  open routine
17291  Returns:
17292  A data byte received by the driver.
17293  Example:
17294  <code>
17295  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17296  char myBuffer[MY_BUFFER_SIZE];
17297  unsigned int numBytes;
17298  numBytes = 0;
17299  do
17300  {
17301  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
17302  {
17303  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
17304  }
17305  // Do something else...
17306  } while( numBytes < MY_BUFFER_SIZE);
17307  </code>
17308  Remarks:
17309  This function is thread safe when called in a RTOS application. Note that
17310  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17311  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17312  DRV_USART_Write functions in a application. Calling the
17313  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
17314  processing of any queued buffers.
17315 */
17316 
17317 uint8_t
17319  const DRV_HANDLE handle ) ;
17320 // *****************************************************************************
17321 /* Function:
17322  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
17323  Summary:
17324  Writes a byte of data to the USART.
17325  <p><b>Implementation:</b> Static/Dynamic</p>
17326  Description:
17327  This routine writes a byte of data to the USART.
17328  Precondition:
17329  The DRV_USART_Initialize routine must have been called for the specified
17330  USART driver instance.
17331  DRV_USART_Open must have been called to obtain a valid opened device handle.
17332  The transfer status should be checked to see if transmitter is not full
17333  before calling this function.
17334  Parameters:
17335  handle - A valid open-instance handle, returned from the driver's
17336  open routine
17337  byte - Data byte to write to the USART
17338  Returns:
17339  None.
17340  Example:
17341  <code>
17342  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17343  char myBuffer[MY_BUFFER_SIZE];
17344  unsigned int numBytes;
17345  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
17346  numBytes = 0;
17347  while( numBytes < MY_BUFFER_SIZE );
17348  {
17349  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
17350  {
17351  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
17352  }
17353  // Do something else...
17354  }
17355  </code>
17356  Remarks:
17357  This function is thread safe when called in a RTOS application. Note that
17358  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17359  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17360  DRV_USART_Write functions in a application. Calling the
17361  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
17362  processing of any queued buffers.
17363 */
17364 
17365 void
17367  const DRV_HANDLE handle ,
17368  const uint8_t byte ) ;
17369 // *****************************************************************************
17370 /* Function:
17371  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
17372  Summary:
17373  Returns the size of the receive buffer.
17374  <p><b>Implementation:</b> Static/Dynamic</p>
17375  Description:
17376  This routine returns the size of the receive buffer.
17377  Precondition:
17378  The DRV_USART_Initialize routine must have been called for the specified
17379  USART driver instance.
17380  DRV_USART_Open must have been called to obtain a valid opened device handle.
17381  Parameters:
17382  handle - A valid open-instance handle, returned from the driver's
17383  open routine
17384  Returns:
17385  Size of the driver's receive buffer, in bytes.
17386  Example:
17387  <code>
17388  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17389  const uint8_t readBuffer[5];
17390  unsigned int size, numBytes = 0;
17391  unsigned int readbufferLen = sizeof(readBuffer);
17392  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
17393  // Do something based on the receiver buffer size
17394  </code>
17395  Remarks:
17396  Does not account for client queued buffers. This function is thread safe
17397  when called in a RTOS application.
17398 */
17399 
17400 unsigned int
17402  const DRV_HANDLE handle ) ;
17403 // *****************************************************************************
17404 /* Function:
17405  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
17406  Summary:
17407  Returns the size of the transmit buffer.
17408  <p><b>Implementation:</b> Static/Dynamic</p>
17409  Description:
17410  This routine returns the size of the transmit buffer and can be used by the
17411  application to determine the number of bytes to write with the
17412  DRV_USART_WriteByte function.
17413  Precondition:
17414  The DRV_USART_Initialize routine must have been called for the specified
17415  USART driver instance.
17416  DRV_USART_Open must have been called to obtain a valid opened device handle.
17417  Parameters:
17418  handle - A valid open-instance handle, returned from the driver's
17419  open routine
17420  Returns:
17421  Size of the driver's transmit buffer, in bytes.
17422  Examples:
17423  <code>
17424  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17425  const uint8_t writeBuffer[5];
17426  unsigned int size, numBytes = 0;
17427  unsigned int writeBufferLen = sizeof(writeBuffer);
17428  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
17429  // Do something based on the transmitter buffer size
17430  </code>
17431  Remarks:
17432  Does not account for client queued buffers. This function is thread safe
17433  when used in a RTOS application.
17434 */
17435 
17436 unsigned int
17438  const DRV_HANDLE handle ) ;
17439 // *****************************************************************************
17440 /* Function:
17441  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
17442  Summary:
17443  Provides the status of the driver's receive buffer.
17444  <p><b>Implementation:</b> Static/Dynamic</p>
17445  Description:
17446  This routine indicates if the driver's receiver buffer is empty. This
17447  function can be used in conjunction with the DRV_USART_Read and
17448  DRV_USART_ReadByte functions.
17449  Precondition:
17450  The DRV_USART_Initialize routine must have been called for the specified
17451  USART driver instance.
17452  DRV_USART_Open must have been called to obtain a valid opened device handle.
17453  Parameters:
17454  handle - A valid open-instance handle, returned from the driver's
17455  open routine
17456  Returns:
17457  true - if the driver's receive buffer is empty
17458  false - if the driver's receive buffer is not empty
17459  Example:
17460  <code>
17461  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17462  char myBuffer[MY_BUFFER_SIZE];
17463  unsigned int numBytes;
17464  numBytes = 0;
17465  while( numBytes < MY_BUFFER_SIZE );
17466  {
17467  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
17468  {
17469  if( numBytes < MY_BUFFER_SIZE )
17470  {
17471  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
17472  }
17473  else
17474  {
17475  break;
17476  }
17477  }
17478  // Do something else while more data is received.
17479  }
17480  </code>
17481  Remarks:
17482  Does not account for client queued buffers. This function is safe thread
17483  safe when used in a RTOS application.
17484 */
17485 
17486 bool
17488  const DRV_HANDLE handle ) ;
17489 // *****************************************************************************
17490 /* Function:
17491  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
17492  Summary:
17493  Provides the status of the driver's transmit buffer.
17494  <p><b>Implementation:</b> Static/Dynamic</p>
17495  Description:
17496  This routine identifies if the driver's transmit buffer is full or not. This
17497  function can be used in conjunction with the DRV_USART_Write and
17498  DRV_USART_WriteByte functions.
17499  Precondition:
17500  The DRV_USART_Initialize routine must have been called for the specified
17501  USART driver instance.
17502  DRV_USART_Open must have been called to obtain a valid opened device handle.
17503  Parameters:
17504  handle - A valid open-instance handle, returned from the driver's
17505  open routine
17506  Returns:
17507  true - if the transmit buffer is full
17508  false - if the transmit buffer is not full
17509  Example:
17510  <code>
17511  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17512  unsigned int numBytes;
17513  int bytesToWrite;
17514  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
17515  int writebufferLen = strlen((char *)writeBuffer);
17516  numBytes = 0;
17517  while( numBytes < writebufferLen )
17518  {
17519  if (DRV_USART_TransmitBufferisFull())
17520  {
17521  // Do something else until there is some room in the driver's Transmit buffer.
17522  }
17523  else
17524  {
17525  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
17526  }
17527  }
17528  </code>
17529  Remarks:
17530  Does not account for client queued buffers. This function is thread safe
17531  when called in a RTOS application.
17532 */
17533 
17534 bool
17536  const DRV_HANDLE handle ) ;
17537 // *****************************************************************************
17538 /* Function:
17539  void DRV_USART_ByteTransmitCallbackSet
17540  (
17541  const SYS_MODULE_INDEX index,
17542  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17543  )
17544  Summary:
17545  Registers a callback function for byte transmit event.
17546  Description:
17547  This function allows a transmit callback function to be registered with the
17548  driver. The callback function is invoked when a byte has been transmitted
17549  using DRV_USART_WriteByte () function.
17550  The callback function should be registered with the driver prior to any
17551  writes to the driver. The callback functionality is available only in the
17552  interrupt mode of operation. The driver clears the interrupt after invoking
17553  the callback function.
17554  Precondition:
17555  The DRV_USART_Initialize routine must have been called for the specified
17556  USART driver instance.
17557  Parameters:
17558  index - Identifier for the object instance to be opened
17559  eventHandler - Pointer to the event handler function.
17560  Returns:
17561  None.
17562  Example:
17563  <code>
17564  // myAppObj is an application specific state data object.
17565  MY_APP_OBJ myAppObj;
17566  uint8_t mybuffer[MY_BUFFER_SIZE];
17567  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17568  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17569  (uintptr_t)&myAppObj );
17570  // Register an event handler with driver. This is done once
17571  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17572  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17573  // Event Processing Technique. Event is received when
17574  // the byte is transmitted.
17575  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17576  {
17577  // Byte has been transmitted. Handle the event.
17578  }
17579  </code>
17580  Remarks:
17581  None
17582 */
17583 
17584 void
17586  const SYS_MODULE_INDEX index ,
17587  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17588 // *****************************************************************************
17589 /* Function:
17590  void DRV_USART_ByteReceiveCallbackSet
17591  (
17592  const SYS_MODULE_INDEX index,
17593  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17594  )
17595  Summary:
17596  Registers receive callback function for byte receive event.
17597  Description:
17598  This function allows a receive callback function to be registered with the
17599  driver. The callback function is invoked when a byte has been received. The
17600  received byte can then be read using DRV_USART_ReadByte() function.
17601  The callback function should be registered with the driver as part of the
17602  initialization. The callback functionality is available only in the
17603  interrupt mode of operation. The driver clears the interrupt after invoking
17604  the callback function.
17605  Precondition:
17606  The DRV_USART_Initialize routine must have been called for the specified
17607  USART driver instance.
17608  Parameters:
17609  index - Identifier for the object instance to be opened
17610  eventHandler - Pointer to the event handler function.
17611  Returns:
17612  None.
17613  Example:
17614  <code>
17615  // myAppObj is an application specific state data object.
17616  MY_APP_OBJ myAppObj;
17617  uint8_t mybuffer[MY_BUFFER_SIZE];
17618  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17619  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17620  (uintptr_t)&myAppObj );
17621  // Register an event handler with driver. This is done once
17622  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17623  // Event Processing Technique. Event is received when
17624  // a byte is received.
17625  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17626  {
17627  // Byte has been Received. Handle the event.
17628  // Read byte using DRV_USART_ReadByte ()
17629  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17630  // check if the receiver buffer is empty.
17631  }
17632  </code>
17633  Remarks:
17634  None
17635 */
17636 
17637 void
17639  const SYS_MODULE_INDEX index ,
17640  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17641 // *****************************************************************************
17642 /* Function:
17643  void DRV_USART_ByteErrorCallbackSet
17644  (
17645  const SYS_MODULE_INDEX index,
17646  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17647  )
17648  Summary:
17649  Registers callback to handle for byte error events.
17650  Description:
17651  This function allows a callback function to be registered with the driver
17652  to handle the error events occurring in the transmit/receive path during
17653  byte transfers.
17654  The callback function should be registered as part of the initialization.
17655  The callback functionality is available only in the interrupt mode of
17656  operation. The driver clears the interrupt after invoking the callback
17657  function.
17658  Precondition:
17659  The DRV_USART_Initialize routine must have been called for the specified
17660  USART driver instance.
17661  Parameters:
17662  index - Identifier for the object instance to be opened
17663  eventHandler - Pointer to the event handler function.
17664  Returns:
17665  None.
17666  Example:
17667  <code>
17668  // myAppObj is an application specific state data object.
17669  MY_APP_OBJ myAppObj;
17670  uint8_t mybuffer[MY_BUFFER_SIZE];
17671  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17672  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17673  (uintptr_t)&myAppObj );
17674  // Register an event handler with driver. This is done once
17675  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17676  // Event Processing Technique.
17677  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17678  {
17679  // Error has occurred. Handle the event.
17680  }
17681  </code>
17682  Remarks:
17683  None
17684 */
17685 
17686 void
17688  const SYS_MODULE_INDEX index ,
17689  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17690 // *****************************************************************************
17691 // *****************************************************************************
17692 // Section: USART Driver Setup and Status Routines
17693 // *****************************************************************************
17694 // *****************************************************************************
17695 // *****************************************************************************
17696 /* Function:
17697  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17698  Summary:
17699  This function returns the error(if any) associated with the last client
17700  request.
17701  <p><b>Implementation:</b> Static/Dynamic</p>
17702  Description:
17703  This function returns the error(if any) associated with the last client
17704  request. DRV_USART_Read and DRV_USART_Write will update the client
17705  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17706  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17707  call this function to know the error cause. The error status will be updated
17708  on every operation and should be read frequently (ideally immediately after
17709  the driver operation has completed) to know the relevant error status.
17710  Precondition:
17711  The DRV_USART_Initialize routine must have been called for the specified
17712  USART driver instance.
17713  DRV_USART_Open must have been called to obtain a valid opened device handle.
17714  Parameters:
17715  bufferhandle - Handle of the buffer of which the processed number of bytes
17716  to be obtained.
17717  Returns:
17718  A DRV_USART_ERROR type indicating last known error status.
17719  Example:
17720  <code>
17721  // myAppObj is an application specific object.
17722  MY_APP_OBJ myAppObj;
17723  uint8_t mybuffer[MY_BUFFER_SIZE];
17724  DRV_USART_BUFFER_HANDLE bufferHandle;
17725  // myUSARTHandle is the handle returned
17726  // by the DRV_USART_Open function.
17727  // Client registers an event handler with driver. This is done once.
17728  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17729  (uintptr_t)&myAppObj );
17730  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17731  myBuffer, MY_BUFFER_SIZE );
17732  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17733  {
17734  // Error handling here
17735  }
17736  // Event Processing Technique. Event is received when
17737  // the buffer is processed.
17738  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17739  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17740  {
17741  // The context handle was set to an application specific
17742  // object. It is now retrievable easily in the event handler.
17743  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17744  size_t processedBytes;
17745  switch(event)
17746  {
17747  case DRV_USART_BUFFER_EVENT_COMPLETE:
17748  // This means the data was transferred.
17749  break;
17750  case DRV_USART_BUFFER_EVENT_ERROR:
17751  // Error handling here.
17752  // We can find out how many bytes were processed in this
17753  // buffer before the error occurred. We can also find
17754  // the error cause.
17755  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17756  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17757  {
17758  // There was an receive over flow error.
17759  // Do error handling here.
17760  }
17761  break;
17762  default:
17763  break;
17764  }
17765  }
17766  </code>
17767  Remarks:
17768  It is the client's responsibility to make sure that the error status is
17769  obtained frequently. The driver will update the client error status
17770  regardless of whether this has been examined by the client. This function
17771  is thread safe when used in a RTOS application.
17772 */
17773 
17776  const DRV_HANDLE client ) ;
17777 // *****************************************************************************
17778 /* Function:
17779  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17780  Summary:
17781  This function changes the USART module baud to the specified value.
17782  <p><b>Implementation:</b> Static/Dynamic</p>
17783  Description:
17784  This function changes the USART module baud to the specified value. Any
17785  queued buffer requests will be processed at the updated baud. The USART
17786  driver operates at the baud specified in DRV_USART_Initialize function
17787  unless the DRV_USART_BaudSet function is called to change the baud.
17788  Precondition:
17789  The DRV_USART_Initialize routine must have been called for the specified
17790  USART driver instance.
17791  DRV_USART_Open must have been called to obtain a valid opened device handle.
17792  Parameters:
17793  handle - client handle returned by DRV_USART_Open function.
17794  baud - desired baud.
17795  Returns:
17796  None.
17797  Example:
17798  <code>
17799  // myUSARTHandle is the handle returned
17800  // by the DRV_USART_Open function.
17801  DRV_USART_BaudSet(myUSARTHandle, 9600);
17802  </code>
17803  Remarks:
17804  The implementation of this function, in this release of the driver, changes
17805  the baud immediately. This may interrupt on-going data transfer. It is
17806  recommended that the driver be opened exclusively if this function is to be
17807  called. This function is thread safe when used in a RTOS application.
17808 */
17809 
17812  const DRV_HANDLE client ,
17813  uint32_t baud ) ;
17814 // *****************************************************************************
17815 /* Function:
17816  void DRV_USART_LineControlSet
17817  (
17818  DRV_HANDLE client,
17819  DRV_USART_LINE_CONTROL lineControl
17820  );
17821  Summary:
17822  This function changes the USART module line control to the specified value.
17823  <p><b>Implementation:</b> Static/Dynamic</p>
17824  Description:
17825  This function changes the USART module line control parameters to the
17826  specified value. Any queued buffer requests will be processed at the
17827  updated line control parameters. The USART driver operates at the line
17828  control parameters specified in DRV_USART_Initialize function unless the
17829  DRV_USART_LineControlSet function is called to change the line control
17830  parameters.
17831  Precondition:
17832  The DRV_USART_Initialize routine must have been called for the specified
17833  USART driver instance.
17834  DRV_USART_Open must have been called to obtain a valid opened device handle.
17835  Parameters:
17836  handle - client handle returned by DRV_USART_Open function.
17837  lineControl - line control parameters.
17838  Returns:
17839  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17840  DRV_HANDLE_INVALID if the client handle is not valid.
17841  Example:
17842  <code>
17843  // myUSARTHandle is the handle returned
17844  // by the DRV_USART_Open function.
17845  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17846  </code>
17847  Remarks:
17848  The implementation of this function, in this release of the driver, changes
17849  the line control immediately. This may interrupt on-going data transfer. It
17850  is recommended that the driver be opened exclusively if this function is to
17851  be called. This function is thread safe when called in a RTOS application.
17852 */
17853 
17856  const DRV_HANDLE client ,
17857  const DRV_USART_LINE_CONTROL lineControl ) ;
17858 //DOM-IGNORE-BEGIN
17859 //DOM-IGNORE-END
17860  // #ifndef _DRV_USART_H
17861 /*******************************************************************************
17862  End of File
17863 */
17864 
17865 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17866 /* CLOSE_FILE Include File */
17867 
17868 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17869 /*******************************************************************************
17870  USART Driver Variant Mapping
17871  Company:
17872  Microchip Technology Inc.
17873  File Name:
17874  drv_usart_variant_mapping.h
17875  Summary:
17876  USART Driver Variant Mapping
17877  Description:
17878  This file provides feature and build variant mapping macros allowing the
17879  driver to easily be built with different implementation variations based
17880  on static build-time configuration selections.
17881 *******************************************************************************/
17882 //DOM-IGNORE-BEGIN
17883 /*******************************************************************************
17884 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17885 Microchip licenses to you the right to use, modify, copy and distribute
17886 Software only when embedded on a Microchip microcontroller or digital signal
17887 controller that is integrated into your product or third party product
17888 (pursuant to the sublicense terms in the accompanying license agreement).
17889 You should refer to the license agreement accompanying this Software for
17890 additional information regarding your rights and obligations.
17891 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17892 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17893 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17894 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17895 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17896 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17897 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17898 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17899 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17900 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17901 *******************************************************************************/
17902 //DOM-IGNORE-END
17903 #ifndef _DRV_USART_FEATURE_MAPPING_H
17904 #define _DRV_USART_FEATURE_MAPPING_H
17905 // *****************************************************************************
17906 // *****************************************************************************
17907 // Section: Interrrupt Variations
17908 // *****************************************************************************
17909 // *****************************************************************************
17910 /* Mapping of the interrupt mode variations
17911 */
17912  /* Driver is configured for polled mode */
17913 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17914 #define _DRV_USART_InterruptSourceEnable( source )
17915 #define _DRV_USART_InterruptSourceDisable( source ) false
17916 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17917 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17918 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17919 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17920 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17921  /* This means the driver is being built in a baremetal application.
17922  We cannot let a client open the driver in blocking mode */
17923 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17924 // *****************************************************************************
17925 // *****************************************************************************
17926 // Section: Buffer Queue support
17927 // *****************************************************************************
17928 // *****************************************************************************
17929 /* Mapping of macros for buffer queue support
17930 */
17931  /* We dont need buffer queues or byte model support */
17932 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17933 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17934 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17935 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17936 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17937 // *****************************************************************************
17938 // *****************************************************************************
17939 // Initializtion Parameter Static Overrides
17940 // *****************************************************************************
17941 // *****************************************************************************
17942  //_DRV_USART_FEATURE_MAPPING_H
17943 /*******************************************************************************
17944  End of File
17945 */
17946 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17947 /* CLOSE_FILE Include File */
17948 
17949 #include "system/clk/sys_clk.h"
17950 #include "system/int/sys_int.h"
17951 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17952 /*******************************************************************************
17953  Debug System Services Library Header
17954  Company:
17955  Microchip Technology Inc.
17956 
17957  File Name:
17958  sys_debug.h
17959  Summary:
17960  Defines the common debug definitions and interfaces used by MPLAB Harmony
17961  libraries to report errors and debug information to the user.
17962  Description:
17963  This header file defines the common debug definitions and interface macros
17964  (summary below) and prototypes used by MPLAB Harmony libraries to report
17965  errors and debug information to the user.
17966  *******************************************************************************/
17967 //DOM-IGNORE-BEGIN
17968 /*******************************************************************************
17969 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17970 Microchip licenses to you the right to use, modify, copy and distribute
17971 Software only when embedded on a Microchip microcontroller or digital signal
17972 controller that is integrated into your product or third party product
17973 (pursuant to the sublicense terms in the accompanying license agreement).
17974 You should refer to the license agreement accompanying this Software for
17975 additional information regarding your rights and obligations.
17976 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17977 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17978 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17979 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17980 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17981 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17982 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17983 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17984 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17985 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17986  *******************************************************************************/
17987 //DOM-IGNORE-END
17988 #ifndef _SYS_DEBUG_H
17989 #define _SYS_DEBUG_H
17990 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17991  /* LDRA full path */
17992 // This should be defined in system_config.h. It is added here as a build safe-guard.
17993 #define SYS_DEBUG_BUFFER_DMA_READY
17994 // *****************************************************************************
17995 // *****************************************************************************
17996 // Section: SYS DEBUG Data Types
17997 // *****************************************************************************
17998 // *****************************************************************************
17999 // *****************************************************************************
18000 /* SYS_ERROR_LEVEL enumeration
18001  Summary:
18002  System error message priority levels.
18003  Description:
18004  This enumeration defines the supported system error message priority values.
18005  Remarks:
18006  Used by debug message macros to compare individual message priority against
18007  a global system-wide error message priority level to determine if an
18008  individual message should be displayed.
18009 */
18010 
18011 typedef
18012  enum
18013  {
18014  /* Errors that have the potential to cause a system crash. */
18016  /* Errors that have the potential to cause incorrect behavior. */
18018  /* Warnings about potentially unexpected behavior or side effects. */
18020  /* Information helpful to understanding potential errors and warnings. */
18022  /* Verbose information helpful during debugging and testing. */
18024  } SYS_ERROR_LEVEL ;
18025 // DOM-IGNORE-BEGIN
18026 // *****************************************************************************
18027 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
18028  SYS_DEBUG_ErrorLevelSet functions to access this value.
18029 */
18030 
18031 extern SYS_ERROR_LEVEL
18032  gblErrLvl ;
18033 // DOM-IGNORE-END
18034 // *****************************************************************************
18035 /* SYS Debug Module Index Number
18036  Summary:
18037  Debug System Service index.
18038  Description:
18039  This constant defines a symbolic name for the debug system service index.
18040  Remarks:
18041  There can only be a single debug system service instance in the system.
18042 */
18043 #define SYS_DEBUG_INDEX_0 0
18044 // *****************************************************************************
18045 /* SYS Debug Initialize structure
18046  Summary:
18047  Defines the data required to initialize the debug system service.
18048  Description:
18049  This structure defines the data required to initialize the debug system
18050  service.
18051  Remarks:
18052  None.
18053 */
18054 
18055 typedef
18056  struct
18057  {
18058  /* System module initialization */
18059  SYS_MODULE_INIT moduleInit ;
18060  /* Initial system error level setting. */
18061  SYS_ERROR_LEVEL errorLevel ;
18062  /* Console index to receive debug messages */
18063  SYS_MODULE_INDEX consoleIndex ;
18064  } SYS_DEBUG_INIT ;
18065 // *****************************************************************************
18066 // *****************************************************************************
18067 // Section: SYS DEBUG Functions
18068 // *****************************************************************************
18069 // *****************************************************************************
18070 // *****************************************************************************
18071 /* Function:
18072  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
18073  const SYS_MODULE_INIT * const init )
18074  Summary:
18075  Initializes the global error level and specific module instance.
18076  Description:
18077  This function initializes the global error level. It also initializes any
18078  internal system debug module data structures.
18079  Precondition:
18080  None.
18081  Parameters:
18082  index - Index for the instance to be initialized
18083  init - Pointer to a data structure containing any data necessary
18084  to initialize the debug service. This pointer may be null
18085  if no data is required because static overrides have
18086  been provided.
18087  Returns:
18088  If successful, returns a valid handle to an object. Otherwise, it
18089  returns SYS_MODULE_OBJ_INVALID.
18090  Example:
18091  <code>
18092  SYS_MODULE_OBJ objectHandle;
18093  SYS_DEBUG_INIT debugInit =
18094  {
18095  .moduleInit = {0},
18096  .errorLevel = SYS_ERROR_DEBUG,
18097  };
18098  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
18099  if (SYS_MODULE_OBJ_INVALID == objectHandle)
18100  {
18101  // Handle error
18102  }
18103  </code>
18104  Remarks:
18105  This routine should only be called once during system initialization. If the
18106  system was already initialized it safely returns without causing any disturbance.
18107 */
18108 
18109 SYS_MODULE_OBJ
18111  const SYS_MODULE_INDEX index ,
18112  const SYS_MODULE_INIT * const init ) ;
18113 // *****************************************************************************
18114 /* Function:
18115  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
18116  const SYS_MODULE_INIT * const init )
18117  Summary:
18118  Reinitializes and refreshes the data structure for the instance of the
18119  Debug module.
18120  Description:
18121  This function reinitializes and refreshes the data structure for the instance
18122  of the Debug module using the supplied data.
18123  Precondition:
18124  The SYS_DEBUG_Initialize function should have been called before calling
18125  this function.
18126  Parameters:
18127  object - Identifies the SYS DEBUG Object returned by the Initialize
18128  interface
18129  init - Pointer to the data structure containing any data
18130  necessary to initialize the hardware
18131  Returns:
18132  None
18133  Example:
18134  <code>
18135  SYS_MODULE_OBJ objectHandle;
18136  // Populate the console initialization structure
18137  SYS_DEBUG_INIT dbgInit =
18138  {
18139  .moduleInit = {0},
18140  .errorLevel = SYS_ERROR_DEBUG,
18141  };
18142  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
18143  </code>
18144  Remarks:
18145  This operation uses the same initialization data structure as the
18146  SYS_DEBUG_Initialize operation. This function can be called multiple times
18147  to reinitialize the module.
18148 */
18149 
18150 void
18152  SYS_MODULE_OBJ object ,
18153  const SYS_MODULE_INIT * const init ) ;
18154 // *****************************************************************************
18155 /* Function:
18156  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
18157  Summary:
18158  Deinitializes the specific module instance of the Debug module.
18159  Description:
18160  This function deinitializes the specific module instance disabling its
18161  operation (and any hardware for driver modules). Resets all of the internal
18162  data structures and fields for the specified instance to the default settings.
18163  Precondition:
18164  The SYS_DEBUG_Initialize function should have been called before calling
18165  this function.
18166  Parameters:
18167  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
18168  Returns:
18169  None.
18170  Example:
18171  <code>
18172  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
18173  SYS_DEBUG_Deinitialize (object);
18174  </code>
18175  Remarks:
18176  Once the Initialize operation has been called, the Deinitialize
18177  operation must be called before the Initialize operation can be called
18178  again.
18179 */
18180 
18181 void
18183  SYS_MODULE_OBJ object ) ;
18184 // *****************************************************************************
18185 /* Function:
18186  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
18187  Summary:
18188  Maintains the debug module's state machine.
18189  Description:
18190  This function is used to maintain the debug module's internal state
18191  machine and implement its ISR for interrupt-driven implementations.
18192  Precondition:
18193  The SYS_DEBUG_Initialize function must have been called for the specified
18194  CONSOLE driver instance.
18195  Parameters:
18196  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
18197  Returns:
18198  None.
18199  Example:
18200  <code>
18201  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
18202  while (true)
18203  {
18204  SYS_DEBUG_Tasks (object);
18205  // Do other tasks
18206  }
18207  </code>
18208  Remarks:
18209  This function is normally not called directly by an application. It is
18210  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
18211  ISR.
18212 */
18213 
18214 void
18215  SYS_DEBUG_Tasks (
18216  SYS_MODULE_OBJ object ) ;
18217 // *****************************************************************************
18218 /* Function:
18219  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
18220  Summary:
18221  Returns status of the specific instance of the debug service module.
18222  Description:
18223  This function returns the status of the specific debug service module
18224  instance.
18225  Precondition:
18226  The SYS_CONSOLE_Initialize function should have been called before calling
18227  this function.
18228  Parameters:
18229  object - Debug module object handle, returned from SYS_DEBUG_Initialize
18230  Returns:
18231  * SYS_STATUS_READY - Indicates that the module is running and
18232  ready to service requests. Any value greater
18233  than SYS_STATUS_READY is also a normal
18234  running state in which the module is ready
18235  to accept new operations.
18236  * SYS_STATUS_BUSY - Indicates that the module is busy with a
18237  previous system level operation and cannot
18238  start another.
18239  * SYS_STATUS_ERROR - Indicates that the module is in an error
18240  state. Any value less than SYS_STATUS_ERROR
18241  is also an error state.
18242  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
18243  initialized or has been deinitialized.
18244  Example:
18245  <code>
18246  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
18247  SYS_STATUS debugStatus;
18248  debugStatus = SYS_DEBUG_Status (object);
18249  if (SYS_STATUS_ERROR >= debugStatus)
18250  {
18251  // Handle error
18252  }
18253  </code>
18254  Remarks:
18255  None.
18256 */
18257 
18258 SYS_STATUS
18260  SYS_MODULE_OBJ object ) ;
18261 // *****************************************************************************
18262 // *****************************************************************************
18263 // Section: SYS DEBUG Console Functions
18264 // *****************************************************************************
18265 // *****************************************************************************
18266 // *****************************************************************************
18267 /* Function:
18268  SYS_DEBUG_Message( const char* message );
18269  Summary:
18270  Prints a message to the console regardless of the system error level.
18271  Description:
18272  This function prints a message to the console regardless of the system
18273  error level. It can be used as an implementation of the SYS_MESSAGE and
18274  SYS_DEBUG_MESSAGE macros.
18275  Precondition:
18276  SYS_DEBUG_Initialize must have returned a valid object handle and the
18277  SYS_DEBUG_Tasks function must be called by the system to complete the
18278  message request.
18279  Parameters:
18280  message - Pointer to a message string to be displayed.
18281  Returns:
18282  None.
18283  Example:
18284  <code>
18285  // In system_config.h:
18286 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
18287 
18288  // In source (.c) files:
18289  SYS_MESSAGE("My Message\n\r");
18290  </code>
18291  Remarks:
18292  Do not call this function directly. Call the SYS_MESSAGE or
18293  SYS_DEBUG_MESSAGE macros instead.
18294 
18295  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
18296  the messages and message function calls from the source code. To access
18297  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
18298  override the definitions of the individual macros.
18299 */
18300 
18301 void
18303  const char * message ) ;
18304 // *****************************************************************************
18305 /* Function:
18306  SYS_DEBUG_Print( const char* format, ... )
18307  Summary:
18308  Formats and prints a message with a variable number of arguments to the
18309  console regardless of the system error level.
18310  Description:
18311  This function formats and prints a message with a variable number of
18312  arguments to the console regardless of the system error level. It can be
18313  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
18314  Precondition:
18315  SYS_DEBUG_Initialize must have returned a valid object handle and the
18316  SYS_DEBUG_Tasks function must be called by the system to complete the
18317  message request.
18318  Parameters:
18319  format - Pointer to a buffer containing the format string for
18320  the message to be displayed.
18321  ... - Zero or more optional parameters to be formated as
18322  defined by the format string.
18323  Returns:
18324  None.
18325  Example:
18326  <code>
18327  // In system_config.h
18328 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
18329 
18330  // In source code
18331  int result;
18332 
18333  result = SomeOperation();
18334  if (result > MAX_VALUE)
18335  {
18336  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18337  }
18338  </code>
18339  Remarks:
18340  The format string and arguments follow the printf convention.
18341 
18342  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
18343  macros instead.
18344 
18345  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
18346  messages and message function calls. To access and utilize the messages,
18347  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
18348  individual macros.
18349 */
18350 
18351 void
18352  SYS_DEBUG_Print (
18353  const char * format ,
18354  ... ) ;
18355 // *****************************************************************************
18356 /* Function:
18357  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
18358  Summary:
18359  Sets the global system error reporting level.
18360  Description:
18361  This function sets the global system error reporting level.
18362 
18363  Precondition:
18364  SYS_DEBUG_Initialize must have returned a valid object handle.
18365  Parameters:
18366  level - The desired system error level.
18367  Returns:
18368  None.
18369  Example:
18370  <code>
18371  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
18372  </code>
18373  Remarks:
18374  None.
18375 */
18376 
18377 void
18379  SYS_ERROR_LEVEL level ) ;
18380 // *****************************************************************************
18381 /* Function:
18382  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
18383  Summary:
18384  Returns the global system Error reporting level.
18385  Description:
18386  This function returns the global System Error reporting level.
18387 
18388  Precondition:
18389  SYS_DEBUG_Initialize must have returned a valid object handle.
18390  Parameters:
18391  None.
18392  Returns:
18393  The global System Error Level.
18394  Example:
18395  <code>
18396  SYS_ERROR_LEVEL level;
18397 
18398  level = SYS_DEBUG_ErrorLevelGet();
18399  </code>
18400  Remarks:
18401  None.
18402 */
18403 
18405  SYS_DEBUG_ErrorLevelGet ( void ) ;
18406 // *****************************************************************************
18407 // *****************************************************************************
18408 // Section: SYS DEBUG Macros
18409 // *****************************************************************************
18410 // *****************************************************************************
18411 // *****************************************************************************
18412 /* Macro:
18413  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
18414  Summary:
18415  Prints a debug message if the specified level is at or below the global
18416  system error level.
18417  Description:
18418  This macro prints a debug message if the specified level is at or below the
18419  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
18420  Precondition:
18421  SYS_DEBUG_Initialize must have returned a valid object handle.
18422  Parameters:
18423  level - The current error level threshold for displaying the message.
18424  message - Pointer to a buffer containing the message to be displayed.
18425  Returns:
18426  None.
18427  Example:
18428  <code>
18429  // In system_config.h
18430 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
18431 
18432  // In library source (.c) code.
18433  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
18434  </code>
18435  Remarks:
18436  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
18437 
18438  The default SYS_DEBUG_MESSAGE macro definition removes the message and
18439  function call from the source code. To access and utilize the message,
18440  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18441  SYS_DEBUG_MESSAGE macro.
18442 */
18443 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
18444 // *****************************************************************************
18445 /* Macro:
18446  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18447  Summary:
18448  Formats and prints a debug message if the specified level is at or below the
18449  global system error level.
18450  Description:
18451  This function formats and prints a debug message if the specified level is
18452  at or below the global system error level. It can be used to implement the
18453  SYS_DEBUG_PRINT macro.
18454  Precondition:
18455  SYS_DEBUG_Initialize must have returned a valid object handle.
18456  Parameters:
18457  level - The current error level threshold for displaying the message.
18458  format - Pointer to a buffer containing the format string for
18459  the message to be displayed.
18460  ... - Zero or more optional parameters to be formated as
18461  defined by the format string.
18462  Returns:
18463  None.
18464  Example:
18465  <code>
18466  // In system_config.h
18467 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18468 
18469  // In source code
18470  int result;
18471 
18472  result = SomeOperation();
18473  if (result > MAX_VALUE)
18474  {
18475  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18476  // Take appropriate action
18477  }
18478  </code>
18479  Remarks:
18480  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
18481 
18482  The default SYS_DEBUG_PRINT macro definition removes the message and
18483  function call from the source code. To access and utilize the message,
18484  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18485  SYS_DEBUG_PRINT macro.
18486 */
18487 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
18488 // DOM-IGNORE-BEGIN
18489 // *****************************************************************************
18490 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
18491  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
18492  (system_config.h) will map the macros below to the appropriate system
18493  console functions.
18494 */
18495 // DOM-IGNORE-END
18496 // *****************************************************************************
18497 /* Macro:
18498  SYS_MESSAGE( const char* message )
18499  Summary:
18500  Prints a message to the console regardless of the system error level.
18501  Description:
18502  This macro is used to print a message to the console regardless of the
18503  system error level. It can be mapped to any desired implementation.
18504  Precondition:
18505  If mapped to the _SYS_MESSAGE function, then the system debug service must
18506  be initialized and running.
18507  Parameters:
18508  message - Pointer to a buffer containing the message string to be
18509  displayed.
18510  Returns:
18511  None.
18512  Example:
18513  <code>
18514  // In system_config.h:
18515 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
18516 
18517  // In source (.c) files:
18518  SYS_MESSAGE("My Message\n\r");
18519  </code>
18520  Remarks:
18521  By default, this macro is defined as nothing, effectively removing all code
18522  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18523  defined in a way that maps calls to it to the desired implementation (see
18524  example, above).
18525 
18526  This macro can be mapped to the system console service (along with other
18527  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18528  configuration (system_config.h) instead of defining it individually.
18529 */
18530 #define SYS_MESSAGE( message )
18531 // *****************************************************************************
18532 /* Function:
18533  SYS_DEBUG_MESSAGE( const char* message )
18534  Summary:
18535  Prints a debug message if the system error level is defined defined at
18536  or lower than the level specified.
18537  Description:
18538  This function prints a debug message if the system error level is defined at
18539  or lower than the level specified.
18540  Precondition:
18541  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
18542  Parameters:
18543  level - The current error level threshold for displaying the message.
18544  message - Pointer to a buffer containing the message to be displayed.
18545  Returns:
18546  None.
18547  Example:
18548  <code>
18549 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18550  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18551  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18552  </code>
18553  Remarks:
18554  By default, this macro is defined as nothing, effectively removing all code
18555  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18556  must be defined in a way that maps calls to it to the desired implementation
18557  (see example, above).
18558 
18559  This macro can be mapped to the system console service (along with other
18560  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18561  configuration (system_config.h) instead of defining it individually.
18562 */
18563 #define SYS_DEBUG_MESSAGE( level , message )
18564 // *****************************************************************************
18565 /* Function:
18566  SYS_PRINT(const char* format, ...);
18567  Summary:
18568  Formats and prints an error message with a variable number of arguments
18569  regardless of the system error level.
18570  Description:
18571  This function formats and prints an error message with a variable number of
18572  if the system error level is defined at or lower than the level specified.
18573  Precondition:
18574  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18575  Parameters:
18576  format - Pointer to a buffer containing the format string for
18577  the message to be displayed.
18578  ... - Zero or more optional parameters to be formated as
18579  defined by the format string.
18580  Returns:
18581  None.
18582  Example:
18583  <code>
18584  // In system_config.h
18585 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18586 
18587  // In source code
18588  int result;
18589 
18590  result = SomeOperation();
18591  if (result > MAX_VALUE)
18592  {
18593  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18594  // Take appropriate action
18595  }
18596  </code>
18597  Remarks:
18598  The format string and arguments follow the printf convention. This function
18599  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18600 
18601  By default, this macro is defined as nothing, effectively removing all code
18602  generated by calls to it. To process SYS_PRINT calls, this macro must be
18603  defined in a way that maps calls to it to the desired implementation (see
18604  example, above).
18605 
18606  This macro can be mapped to the system console service (along with other
18607  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18608  configuration (system_config.h) instead of defining it individually.
18609 */
18610 #define SYS_PRINT( fmt ,... )
18611 // *****************************************************************************
18612 /* Macro:
18613  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18614  Summary:
18615  Formats and prints an error message if the system error level is defined at
18616  or lower than the level specified.
18617  Description:
18618  This macro formats and prints an error message if the system error level
18619  is defined at or lower than the level specified.o
18620  Precondition:
18621  SYS_DEBUG_Initialize must have returned a valid object handle.
18622  Parameters:
18623  level - The current error level threshold for displaying the message.
18624  format - Pointer to a buffer containing the format string for
18625  the message to be displayed.
18626  ... - Zero or more optional parameters to be formated as
18627  defined by the format string.
18628  Returns:
18629  None.
18630  Example:
18631  <code>
18632  // In system_config.h
18633 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18634 
18635  // In source code
18636  int result;
18637 
18638  result = SomeOperation();
18639  if (result > MAX_VALUE)
18640  {
18641  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18642  // Take appropriate action
18643  }
18644  </code>
18645  Remarks:
18646  The format string and arguments follow the printf convention. This function
18647  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18648 
18649  By default, this macro is defined as nothing, effectively removing all code
18650  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18651  defined in a way that maps calls to it to the desired implementation (see
18652  example, above).
18653 
18654  This macro can be mapped to the system console service (along with other
18655  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18656  configuration (system_config.h) instead of defining it individually.
18657 */
18658 #define SYS_DEBUG_PRINT( level , fmt ,... )
18659 // *****************************************************************************
18660 /* Macro:
18661  SYS_DEBUG_BreakPoint( void )
18662  Summary:
18663  Inserts a software breakpoint instruction when building in Debug mode.
18664  Description:
18665  This macro inserts a software breakpoint instruction when building in Debug
18666  mode.
18667  Precondition:
18668  None.
18669  Parameters:
18670  None.
18671  Returns:
18672  None.
18673  Example:
18674  <code>
18675  if (myDebugTestFailed)
18676  {
18677  SYS_DEBUG_BreakPoint();
18678  }
18679  </code>
18680  Remarks:
18681  Compiles out if not built for debugging.
18682 */
18683 #define SYS_DEBUG_BreakPoint( )
18684 // *****************************************************************************
18685 // *****************************************************************************
18686 // Section: SYS DEBUG Deprecated Macros
18687 // *****************************************************************************
18688 // *****************************************************************************
18689 /* Do not use these macros for new development.
18690 */
18691 //DOM-IGNORE-BEGIN
18692 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18693 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18694 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18695 //DOM-IGNORE-END
18696  // _SYS_DEBUG_H
18697 /*******************************************************************************
18698  End of File
18699 */
18700 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18701 /* CLOSE_FILE Include File */
18702 
18703 // DOM-IGNORE-BEGIN
18704 // DOM-IGNORE-END
18705 // *****************************************************************************
18706 // *****************************************************************************
18707 // Section: Data Type Definitions
18708 // *****************************************************************************
18709 // *****************************************************************************
18710 /* USART FIFO+RX(8+1) size */
18711 #define _DRV_USART_RX_DEPTH 9
18712 // *****************************************************************************
18713 /* USART Static Driver Instance Object
18714  Summary:
18715  Object used to keep any data required for the static USART driver.
18716  Description:
18717  This object is used to keep track of any data that must be maintained to
18718  manage the USART static driver.
18719  Remarks:
18720  None.
18721 */
18722 
18723 typedef
18724  struct
18725  {
18726  /* Client specific error */
18727  DRV_USART_ERROR error ;
18728  } DRV_USART_OBJ ;
18729 // *****************************************************************************
18730 // *****************************************************************************
18731 // Section: Local functions.
18732 // *****************************************************************************
18733 // *****************************************************************************
18734 // DOM-IGNORE-BEGIN
18735 // DOM-IGNORE-END
18736  //#ifndef _DRV_USART_STATIC_LOCAL_H
18737 /*******************************************************************************
18738  End of File
18739 */
18740 
18741 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18742 /* CLOSE_FILE Include File */
18743 
18744 // DOM-IGNORE-BEGIN
18745 // DOM-IGNORE-END
18746 // *********************************************************************************************
18747 // *********************************************************************************************
18748 // Section: System Interface Headers for the Instance 0 of USART static driver
18749 // *********************************************************************************************
18750 // *********************************************************************************************
18751 
18752 SYS_MODULE_OBJ
18753  DRV_USART0_Initialize ( void ) ;
18754 
18755 void
18756  DRV_USART0_Deinitialize ( void ) ;
18757 
18758 SYS_STATUS
18759  DRV_USART0_Status ( void ) ;
18760 
18761 void
18762  DRV_USART0_TasksTransmit ( void ) ;
18763 
18764 void
18765  DRV_USART0_TasksReceive ( void ) ;
18766 
18767 void
18768  DRV_USART0_TasksError ( void ) ;
18769 // *********************************************************************************************
18770 // *********************************************************************************************
18771 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18772 // *********************************************************************************************
18773 // *********************************************************************************************
18774 
18775 DRV_HANDLE
18776  DRV_USART0_Open (
18777  const SYS_MODULE_INDEX index ,
18778  const DRV_IO_INTENT ioIntent ) ;
18779 
18780 void
18781  DRV_USART0_Close ( void ) ;
18782 
18784  DRV_USART0_ClientStatus ( void ) ;
18785 
18787  DRV_USART0_TransferStatus ( void ) ;
18788 
18790  DRV_USART0_ErrorGet ( void ) ;
18791 // *********************************************************************************************
18792 // *********************************************************************************************
18793 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18794 // *********************************************************************************************
18795 // *********************************************************************************************
18796 
18797 uint8_t
18798  DRV_USART0_ReadByte ( void ) ;
18799 
18800 void
18802  const uint8_t byte ) ;
18803 
18804 unsigned int
18806 
18807 unsigned int
18809 
18810 bool
18812 
18813 bool
18815 // *********************************************************************************************
18816 // *********************************************************************************************
18817 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18818 // *********************************************************************************************
18819 // *********************************************************************************************
18820 
18823  uint32_t baud ) ;
18824 
18827  DRV_USART_LINE_CONTROL lineControlMode ) ;
18828 // DOM-IGNORE-BEGIN
18829 // DOM-IGNORE-END
18830  // #ifndef _DRV_USART_STATIC_H
18831 /*******************************************************************************
18832  End of File
18833 */
18834 
18835 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18836 /* CLOSE_FILE Include File */
18837 
18838 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18839 /*******************************************************************************
18840  Ports System Service Interface Definition
18841  Company:
18842  Microchip Technology Inc.
18843  File Name:
18844  sys_ports.h
18845  Summary:
18846  Ports System Service interface definitions
18847  Description:
18848  This file contains the interface definition for the Ports system
18849  service. It provides a way to interact with the Ports subsystem to
18850  manage the timing requests supported by the system
18851 *******************************************************************************/
18852 //DOM-IGNORE-BEGIN
18853 /*******************************************************************************
18854 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18855 Microchip licenses to you the right to use, modify, copy and distribute
18856 Software only when embedded on a Microchip microcontroller or digital signal
18857 controller that is integrated into your product or third party product
18858 (pursuant to the sublicense terms in the accompanying license agreement).
18859 You should refer to the license agreement accompanying this Software for
18860 additional information regarding your rights and obligations.
18861 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18862 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18863 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18864 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18865 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18866 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18867 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18868 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18869 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18870 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18871 *******************************************************************************/
18872 //DOM-IGNORE-END
18873 #ifndef _SYS_PORTS_H
18874 #define _SYS_PORTS_H
18875 // *****************************************************************************
18876 // *****************************************************************************
18877 // Section: Included Files
18878 // *****************************************************************************
18879 // *****************************************************************************
18880 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18881 /*******************************************************************************
18882  PORTS System Service Library Interface Definition
18883  Company:
18884  Microchip Technology Inc.
18885  File Name:
18886  sys_ports_definitions.h
18887  Summary:
18888  PORTS System Service data type definitions header.
18889  Description:
18890  This file contains data type definitions header.
18891 *******************************************************************************/
18892 //DOM-IGNORE-BEGIN
18893 /*******************************************************************************
18894 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18895 Microchip licenses to you the right to use, modify, copy and distribute
18896 Software only when embedded on a Microchip microcontroller or digital signal
18897 controller that is integrated into your product or third party product
18898 (pursuant to the sublicense terms in the accompanying license agreement).
18899 You should refer to the license agreement accompanying this Software for
18900 additional information regarding your rights and obligations.
18901 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18902 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18903 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18904 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18905 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18906 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18907 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18908 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18909 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18910 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18911 *******************************************************************************/
18912 //DOM-IGNORE-END
18913 #ifndef _SYS_PORTS_DEFINITIONS_H
18914 #define _SYS_PORTS_DEFINITIONS_H
18915 // *****************************************************************************
18916 // *****************************************************************************
18917 // Section: File includes
18918 // *****************************************************************************
18919 // *****************************************************************************
18920 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18921 #include "system/common/sys_common.h"
18922 #include "system/common/sys_module.h"
18923 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18924 /*******************************************************************************
18925  Ports Peripheral Library Interface Header
18926  Company:
18927  Microchip Technology Inc.
18928  File Name:
18929  plib_ports.h
18930  Summary:
18931  Ports Peripheral Library Interface header for Ports function definitions.
18932  Description:
18933  This header file contains the function prototypes and definitions of
18934  the data types and constants that make up the interface to the Ports
18935  Peripheral Library for all families of Microchip microcontrollers. The
18936  definitions in this file are common to the Ports peripheral.
18937 *******************************************************************************/
18938 // DOM-IGNORE-BEGIN
18939 /*******************************************************************************
18940 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18941 Microchip licenses to you the right to use, modify, copy and distribute
18942 Software only when embedded on a Microchip microcontroller or digital signal
18943 controller that is integrated into your product or third party product
18944 (pursuant to the sublicense terms in the accompanying license agreement).
18945 You should refer to the license agreement accompanying this Software for
18946 additional information regarding your rights and obligations.
18947 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18948 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18949 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18950 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18951 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18952 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18953 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18954 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18955 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18956 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18957 *******************************************************************************/
18958 // DOM-IGNORE-END
18959 #ifndef _PLIB_PORTS_H
18960 #define _PLIB_PORTS_H
18961 #include <stdint.h>
18962 #include <stddef.h>
18963 // DOM-IGNORE-BEGIN
18964 // DOM-IGNORE-END
18965 // *****************************************************************************
18966 // *****************************************************************************
18967 // Section: Constants & Data Types
18968 // *****************************************************************************
18969 // *****************************************************************************
18970 // *****************************************************************************
18971 /* Ports data mask definition
18972  Summary:
18973  Data type defining the Ports data mask
18974  Description:
18975  This data type defines the Ports data mask
18976  Remarks:
18977  None.
18978 */
18979 
18980 typedef
18981 uint16_t
18983 // *****************************************************************************
18984 /* Ports data type definition
18985  Summary:
18986  Data type defining the Ports data type.
18987  Description:
18988  This data type defines the Ports data type.
18989  Remarks:
18990  None.
18991 */
18992 
18993 typedef
18994 uint32_t
18996 // *****************************************************************************
18997 // *****************************************************************************
18998 // Section: Included Files (continued at end of file)
18999 // *****************************************************************************
19000 // *****************************************************************************
19001 /* This section lists the other files that are included in this file. However,
19002  please see the end of the file for additional implementation header files
19003  that are also included.
19004 */
19005 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
19006 //DOM-IGNORE-BEGIN
19007 /*******************************************************************************
19008 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
19009 Microchip licenses to you the right to use, modify, copy and distribute
19010 Software only when embedded on a Microchip microcontroller or digital signal
19011 controller that is integrated into your product or third party product
19012 (pursuant to the sublicense terms in the accompanying license agreement).
19013 You should refer to the license agreement accompanying this Software for
19014 additional information regarding your rights and obligations.
19015 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
19016 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
19017 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
19018 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
19019 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
19020 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
19021 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
19022 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
19023 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
19024 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
19025  *******************************************************************************/
19026 //DOM-IGNORE-END
19027 #ifndef _PLIB_PORTS_PROCESSOR_H
19028 #define _PLIB_PORTS_PROCESSOR_H
19029 #error "Can't find header"
19030 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
19031 /* CLOSE_FILE Include File */
19032 
19033 // *****************************************************************************
19034 // *****************************************************************************
19035 // Section: Ports Peripheral Library Interface Routines
19036 // *****************************************************************************
19037 // *****************************************************************************
19038 // *****************************************************************************
19039 /* Function:
19040  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
19041  PORTS_REMAP_INPUT_FUNCTION inputFunction,
19042  PORTS_REMAP_INPUT_PIN remapInputPin );
19043  Summary:
19044  Input function remapping.
19045  Description:
19046  This function controls the Input function remapping. It allows user to map
19047  any of the input functionality on any of the remappable input pin.
19048  This function does not perform atomic register access.
19049  Precondition:
19050  IOLOCK bit of configuration register should be clear to allow any remapping.
19051  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
19052  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
19053  find more information.
19054  Parameters:
19055  index - Identifier for the device instance to be configured
19056  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
19057  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
19058  Returns:
19059  None.
19060  Example:
19061  <code>
19062 
19063  // System Unlock
19064  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
19065  // Unlock PPS registers
19066  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
19067  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
19068  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
19069  </code>
19070  Remarks:
19071  This feature may not be available on all devices. Please refer to the
19072  specific device data sheet to determine availability or use
19073  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
19074  this feature is available.
19075 */
19076 
19077 void
19079  PORTS_MODULE_ID index ,
19080  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
19081  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
19082 // *****************************************************************************
19083 /* Function:
19084  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
19085  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
19086  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
19087  Summary:
19088  Output function remapping.
19089  Description:
19090  This function controls the Output function remapping. it allows user to map
19091  any of the output functionality on any of the remappable output pin.
19092  This function does not perform atomic register access.
19093  Precondition:
19094  IOLOCK bit of configuration register should be clear to allow any remapping.
19095  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
19096  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
19097  find more information.
19098  Parameters:
19099  index - Identifier for the device instance to be configured
19100  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
19101  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
19102  Returns:
19103  None.
19104  Example:
19105  <code>
19106 
19107  // System Unlock
19108  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
19109  // Unlock PPS registers
19110  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
19111  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
19112  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
19113 
19114  </code>
19115  Remarks:
19116  This feature may not be available on all devices. Please refer to the
19117  specific device data sheet to determine availability or use
19118  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
19119  this feature is available.
19120 */
19121 
19122 void
19124  PORTS_MODULE_ID index ,
19125  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
19126  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
19127 // *****************************************************************************
19128 /* Function:
19129  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
19130  PORTS_ANALOG_PIN pin,
19131  PORTS_PIN_MODE mode );
19132  Summary:
19133  Enables the selected pin as analog or digital.
19134  Description:
19135  This function enables the selected pin as analog or digital.
19136  This function does not perform atomic register access.
19137  Precondition:
19138  None.
19139  Parameters:
19140  index - Identifier for the device instance to be configured
19141  pin - Possible values of PORTS_ANALOG_PIN
19142  mode - Possible values of PORTS_PIN_MODE
19143  Returns:
19144  None.
19145  Example:
19146  <code>
19147 
19148  // Make AN0 pin as Analog
19149  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
19150 
19151  </code>
19152  Remarks:
19153  This feature may not be available on all devices. Please refer to the
19154  specific device data sheet to determine availability or use
19155  PLIB_PORTS_ExistsPinMode in your application to determine whether
19156  this feature is available.
19157 */
19158 
19159 void
19161  PORTS_MODULE_ID index ,
19162  PORTS_ANALOG_PIN pin ,
19163  PORTS_PIN_MODE mode ) ;
19164 // *****************************************************************************
19165 /* Function:
19166  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
19167  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
19168  PORTS_PIN_MODE mode );
19169  Summary:
19170  Enables the selected port pin as analog or digital.
19171  Description:
19172  This function enables the selected port pin as analog or digital.
19173  This function does not perform atomic register access.
19174  Precondition:
19175  None.
19176  Parameters:
19177  index - Identifier for the device instance to be configured
19178  channel - Port pin channel
19179  bitPos - Position in the PORT pins
19180  mode - Possible values of PORTS_PIN_MODE
19181  Returns:
19182  None.
19183  Example:
19184  <code>
19185 
19186  // Make RC5 pin Analog
19187  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
19188  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
19189 
19190  </code>
19191  Remarks:
19192  This function is only available in devices with PPS. For Non-PPS devices, use the
19193  PLIB_PORTS_PinModeSelect function.
19194 
19195  This feature may not be available on all devices. Please refer to the
19196  specific device data sheet to determine availability or use
19197  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19198  this feature is available.
19199 */
19200 
19201 void
19203  PORTS_MODULE_ID index ,
19204  PORTS_CHANNEL channel ,
19205  PORTS_BIT_POS bitPos ,
19206  PORTS_PIN_MODE mode ) ;
19207 // *****************************************************************************
19208 /* Function:
19209  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
19210  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19211  Summary:
19212  Enables the pull-down for selected Change Notice pins.
19213  Description:
19214  This function enables the pull-down for selected Change Notice pins.
19215  This function does not perform atomic register access.
19216  Precondition:
19217  None.
19218  Parameters:
19219  index - Identifier for the device instance to be configured
19220  channel - Port pin channel
19221  bitPos - Position in the PORT pins
19222  Returns:
19223  None.
19224  Example:
19225  <code>
19226 
19227  // Enable pull-down for RC5 pin
19228  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19229  PORTS_BIT_POS_5);
19230 
19231  </code>
19232  Remarks:
19233  This feature may not be available on all devices. Please refer to the
19234  specific device data sheet to determine availability or use
19235  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19236  determine whether this feature is available.
19237 */
19238 
19239 void
19241  PORTS_MODULE_ID index ,
19242  PORTS_CHANNEL channel ,
19243  PORTS_BIT_POS bitPos ) ;
19244 // *****************************************************************************
19245 /* Function:
19246  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
19247  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19248  Summary:
19249  Disables the pull-down for selected Change Notice pins.
19250  Description:
19251  This function disables the pull-down for selected Change Notice pins.
19252  This function does not perform atomic register access.
19253  Precondition:
19254  None.
19255  Parameters:
19256  index - Identifier for the device instance to be configured
19257  channel - Port pin channel
19258  bitPos - Position in the PORT pins
19259  Returns:
19260  None.
19261  Example:
19262  <code>
19263 
19264  // Disable pull-down for RC5 pin
19265  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19266  PORTS_BIT_POS_5);
19267  </code>
19268  Remarks:
19269  This feature may not be available on all devices. Please refer to the
19270  specific device data sheet to determine availability or use
19271  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19272  determine whether this feature is available.
19273 */
19274 
19275 void
19277  PORTS_MODULE_ID index ,
19278  PORTS_CHANNEL channel ,
19279  PORTS_BIT_POS bitPos ) ;
19280 // *****************************************************************************
19281 /* Function:
19282  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
19283  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19284  Summary:
19285  Enables the pull-up for selected Change Notice pins.
19286  Description:
19287  This function enables the pull-up for selected Change Notice pins.
19288  This function does not perform atomic register access.
19289  Precondition:
19290  None.
19291  Parameters:
19292  index - Identifier for the device instance to be configured
19293  channel - Port pin channel
19294  bitPos - Position in the PORT pins
19295  Returns:
19296  None.
19297  Example:
19298  <code>
19299 
19300  // Enable pull-up for RC5 pin
19301  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19302  PORTS_BIT_POS_5);
19303  </code>
19304  Remarks:
19305  This function is only available in devices with PPS. For Non-PPS devices, use the
19306  PLIB_PORTS_ChangeNoticePullUpEnable function.
19307 
19308  This feature may not be available on all devices. Please refer to the
19309  specific device data sheet to determine availability or use
19310  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19311  determine whether this feature is available.
19312 */
19313 
19314 void
19316  PORTS_MODULE_ID index ,
19317  PORTS_CHANNEL channel ,
19318  PORTS_BIT_POS bitPos ) ;
19319 // *****************************************************************************
19320 /* Function:
19321  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
19322  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19323  Summary:
19324  Disables weak pull-up for the selected pin.
19325  Description:
19326  This function disables weak pull-up for the selected port pin.
19327  This function does not perform atomic register access.
19328  Precondition:
19329  None.
19330  Parameters:
19331  index - Identifier for the device instance to be configured
19332  channel - Port pin channel
19333  bitPos - Position in the PORT pins
19334  Returns:
19335  None.
19336  Example:
19337  <code>
19338 
19339  // Disable pull-up for RC5 pin
19340  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19341  PORTS_BIT_POS_5);
19342 
19343  </code>
19344  Remarks:
19345  This function is only available in devices with PPS. For Non-PPS devices, use the
19346  PLIB_PORTS_ChangeNoticePullUpDisable function.
19347 
19348  Pull-ups on change notification pins should always be disabled when the
19349  port pin is configured as a digital output.
19350 
19351  This feature may not be available on all devices. Please refer to the
19352  specific device data sheet to determine availability or use
19353  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19354  determine whether this feature is available.
19355 */
19356 
19357 void
19359  PORTS_MODULE_ID index ,
19360  PORTS_CHANNEL channel ,
19361  PORTS_BIT_POS bitPos ) ;
19362 // *****************************************************************************
19363 /* Function:
19364  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
19365  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19366  Summary:
19367  Enables CN interrupt for the selected pin.
19368  Description:
19369  This function enables Change Notice interrupt for the selected port pin.
19370  This function does not perform atomic register access.
19371 
19372  Precondition:
19373  None.
19374  Parameters:
19375  index - Identifier for the device instance to be configured
19376  channel - Port pin channel
19377  bitPos - Position in the PORT pins
19378  Returns:
19379  None.
19380  Example:
19381  <code>
19382 
19383  // Enable CN interrupt for RC5 pin
19384  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19385  PORTS_BIT_POS_5);
19386 
19387  </code>
19388  Remarks:
19389  This function is only available in devices with PPS. For Non-PPS devices, use the
19390  PLIB_PORTS_PinChangeNoticeEnable function.
19391 
19392  This feature may not be available on all devices. Please refer to the
19393  specific device data sheet to determine availability or use
19394  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19395  determine whether this feature is available.
19396 */
19397 
19398 void
19400  PORTS_MODULE_ID index ,
19401  PORTS_CHANNEL channel ,
19402  PORTS_BIT_POS bitPos ) ;
19403 // *****************************************************************************
19404 /* Function:
19405  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
19406  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19407  Summary:
19408  Disables CN interrupt for the selected pin.
19409  Description:
19410  This function disables Change Notice interrupt for the selected port pin.
19411  This function does not perform atomic register access.
19412  Precondition:
19413  None.
19414  Parameters:
19415  index - Identifier for the device instance to be configured
19416  channel - Port pin channel
19417  bitPos - Position in the PORT pins
19418  Returns:
19419  None.
19420  Example:
19421  <code>
19422 
19423  // Disable CN interrupt for RC5 pin
19424  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19425  PORTS_BIT_POS_5);
19426 
19427  </code>
19428  Remarks:
19429  This function is only available in devices with PPS. For Non-PPS devices, use the
19430  PLIB_PORTS_PinChangeNoticeDisable function.
19431 
19432  This feature may not be available on all devices. Please refer to the
19433  specific device data sheet to determine availability or use
19434  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19435  determine whether this feature is available.
19436 */
19437 
19438 void
19440  PORTS_MODULE_ID index ,
19441  PORTS_CHANNEL channel ,
19442  PORTS_BIT_POS bitPos ) ;
19443 // *****************************************************************************
19444 /* Function:
19445  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
19446  PORTS_CHANNEL channel );
19447  Summary:
19448  Enables the change notification for selected port.
19449  Description:
19450  This function enables the change notification for selected port.
19451  This function does not perform atomic register access.
19452  Precondition:
19453  None.
19454  Parameters:
19455  index - Identifier for the device instance to be configured
19456  channel - Port pin channel
19457  Returns:
19458  None.
19459  Example:
19460  <code>
19461  // Enable Change notification for Port C
19462  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
19463 
19464  </code>
19465  Remarks:
19466  This function is only available in devices with PPS. For Non-PPS devices, use the
19467  PLIB_PORTS_ChangeNoticeEnable function.
19468 
19469  This feature may not be available on all devices. Please refer to the
19470  specific device data sheet to determine availability or use
19471  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19472  whether this feature is available.
19473 */
19474 
19475 void
19477  PORTS_MODULE_ID index ,
19478  PORTS_CHANNEL channel ) ;
19479 // *****************************************************************************
19480 /* Function:
19481  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
19482  PORTS_CHANNEL channel );
19483  Summary:
19484  Disables the change notification for selected port.
19485  Description:
19486  This function disables the change notification for selected port.
19487  This function does not perform atomic register access.
19488  Precondition:
19489  None.
19490  Parameters:
19491  index - Identifier for the device instance to be configured
19492  channel - Port pin channel
19493  Returns:
19494  None.
19495  Example:
19496  <code>
19497  // Disable Change notification for Port C
19498  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
19499 
19500  </code>
19501  Remarks:
19502  This function is only available in devices with PPS. For Non-PPS devices, use the
19503  PLIB_PORTS_ChangeNoticeDisable function.
19504 
19505  This feature may not be available on all devices. Please refer to the
19506  specific device data sheet to determine availability or use
19507  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19508  whether this feature is available.
19509 */
19510 
19511 void
19513  PORTS_MODULE_ID index ,
19514  PORTS_CHANNEL channel ) ;
19515 // *****************************************************************************
19516 /* Function:
19517  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
19518  PORTS_CHANNEL channel );
19519  Summary:
19520  Allows CN to be working in Idle mode for selected channel.
19521  Description:
19522  This function makes sure that change notification feature keeps working in
19523  Idle mode for the selected channel.
19524  This function does not perform atomic register access.
19525  Precondition:
19526  None.
19527  Parameters:
19528  index - Identifier for the device instance to be configured
19529  channel - Port pin channel
19530  Returns:
19531  None.
19532  Example:
19533  <code>
19534 
19535  // Change notification continues working in Idle mode for Port C
19536  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
19537 
19538  </code>
19539  Remarks:
19540  This function is only available in devices with PPS. For Non-PPS devices, use the
19541  PLIB_PORTS_ChangeNoticeInIdleEnable function.
19542 
19543  This feature may not be available on all devices. Please refer to the
19544  specific device data sheet to determine availability or use
19545  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19546  whether this feature is available.
19547 */
19548 
19549 void
19551  PORTS_MODULE_ID index ,
19552  PORTS_CHANNEL channel ) ;
19553 // *****************************************************************************
19554 /* Function:
19555  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19556  PORTS_CHANNEL channel );
19557  Summary:
19558  Change Notification halts in Idle mode for selected channel.
19559  Description:
19560  This function makes sure that change notification feature halts in
19561  Idle mode for the selected channel.
19562  This function does not perform atomic register access.
19563  Precondition:
19564  None.
19565  Parameters:
19566  index - Identifier for the device instance to be configured
19567  channel - Port pin channel
19568  Returns:
19569  None.
19570  Example:
19571  <code>
19572 
19573  // Change notification halts in Idle mode for Port C
19574  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19575 
19576  </code>
19577  Remarks:
19578  This function is only available in devices with PPS. For Non-PPS devices, use the
19579  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19580 
19581  This feature may not be available on all devices. Please refer to the
19582  specific device data sheet to determine availability or use
19583  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19584  whether this feature is available.
19585 */
19586 
19587 void
19589  PORTS_MODULE_ID index ,
19590  PORTS_CHANNEL channel ) ;
19591 // *****************************************************************************
19592 /* Function:
19593  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19594  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19595  Summary:
19596  checks the status of change on the pin
19597  Description:
19598  This function checks if the change has occurred on the given pin or not.
19599  This function does not perform atomic register access.
19600  Precondition:
19601  None.
19602  Parameters:
19603  index - Identifier for the device instance to be configured
19604  channel - Port pin channel
19605  bitPos - Position in the PORT pins
19606  Returns:
19607  None.
19608  Example:
19609  <code>
19610 
19611  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19612  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19613  {
19614  //do something
19615  }
19616 
19617  </code>
19618  Remarks:
19619  This feature may not be available on all devices. Please refer to the
19620  specific device data sheet to determine availability or use
19621  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19622  whether this feature is available.
19623 */
19624 
19625 bool
19627  PORTS_MODULE_ID index ,
19628  PORTS_CHANNEL channel ,
19629  PORTS_BIT_POS bitPos ) ;
19630 // *****************************************************************************
19631 /* Function:
19632  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19633  PORTS_BIT_POS bitPos )
19634  Summary:
19635  Reads/Gets data from the selected digital pin.
19636  Description:
19637  This function reads/gets data from the selected digital PORT i/o pin.
19638  This function should be used to read the live data at the pin.
19639  This function does not perform atomic register access.
19640 
19641  Precondition:
19642  None.
19643  Parameters:
19644  index - Identifier for the device instance to be configured
19645  channel - Identifier for the Ports channel A, B, C, etc.
19646  bitPos - Possible values of PORTS_BIT_POS
19647  Returns:
19648  Port pin read data.
19649  Example:
19650  <code>
19651  // read port pin RC4
19652  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19653  PORTS_BIT_POS_4);
19654  </code>
19655  Remarks:
19656  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19657 
19658  This feature may not be available on all devices. Please refer to the
19659  specific device data sheet to determine availability or use
19660  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19661  this feature is available.
19662 */
19663 
19664 bool
19666  PORTS_MODULE_ID index ,
19667  PORTS_CHANNEL channel ,
19668  PORTS_BIT_POS bitPos ) ;
19669 // *****************************************************************************
19670 /* Function:
19671  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19672  PORTS_BIT_POS bitPos )
19673  Summary:
19674  Reads/Gets data from the selected latch.
19675  Description:
19676  This function reads/gets data from the selected PORTx Data Latch, not from
19677  the port I/O pins.
19678  This function does not perform atomic register access.
19679 
19680  Precondition:
19681  None.
19682  Parameters:
19683  index - Identifier for the device instance to be configured
19684  channel - Identifier for the Ports channel A, B, C, etc.
19685  bitPos - Possible values of PORTS_BIT_POS
19686  Returns:
19687  Latch read data.
19688  Example:
19689  <code>
19690  // read latch RC4
19691  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19692  PORTS_BIT_POS_4);
19693  </code>
19694  Remarks:
19695  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19696  should be used.
19697 
19698  This feature may not be available on all devices. Please refer to the
19699  specific device data sheet to determine availability or use
19700  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19701  this feature is available.
19702 */
19703 
19704 bool
19706  PORTS_MODULE_ID index ,
19707  PORTS_CHANNEL channel ,
19708  PORTS_BIT_POS bitPos ) ;
19709 // *****************************************************************************
19710 /* Function:
19711  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19712  PORTS_BIT_POS bitPos,
19713  bool value )
19714  Summary:
19715  Writes the selected digital pin/latch.
19716  Description:
19717  This function writes to the selected digital pin/latch.
19718  This function does not perform atomic register access.
19719  Precondition:
19720  None.
19721  Parameters:
19722  index - Identifier for the device instance to be configured
19723  channel - Identifier for the Ports channel A, B, C, etc.
19724  bitPos - Possible values of PORTS_BIT_POS
19725  value - Value to be written to the specific pin/latch
19726  true - sets the bit, false - clears the bit
19727  Returns:
19728  None.
19729  Example:
19730  <code>
19731 
19732  // write 'one' in port RC4
19733  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19734 
19735  </code>
19736  Remarks:
19737  This feature may not be available on all devices. Please refer to the
19738  specific device data sheet to determine availability or use
19739  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19740  this feature is available.
19741 */
19742 
19743 void
19745  PORTS_MODULE_ID index ,
19746  PORTS_CHANNEL channel ,
19747  PORTS_BIT_POS bitPos ,
19748  bool value ) ;
19749 // *****************************************************************************
19750 /* Function:
19751  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19752  PORTS_BIT_POS bitPos )
19753  Summary:
19754  Sets the selected digital pin/latch.
19755  Description:
19756  This function sets the selected digital pin/latch.
19757  This function does not perform atomic register access.
19758  Precondition:
19759  None.
19760  Parameters:
19761  index - Identifier for the device instance to be configured
19762  channel - Identifier for the Ports channel A, B, C, etc.
19763  bitPos - Possible values of PORTS_BIT_POS
19764  Returns:
19765  None.
19766  Example:
19767  <code>
19768 
19769  // Sets port pin RC4
19770  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19771 
19772  </code>
19773  Remarks:
19774  This feature may not be available on all devices. Please refer to the
19775  specific device data sheet to determine availability or use
19776  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19777  this feature is available.
19778 */
19779 
19780 void
19782  PORTS_MODULE_ID index ,
19783  PORTS_CHANNEL channel ,
19784  PORTS_BIT_POS bitPos ) ;
19785 // *****************************************************************************
19786 /* Function:
19787  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19788  PORTS_BIT_POS bitPos )
19789  Summary:
19790  Clears the selected digital pin/latch.
19791  Description:
19792  This function clears the selected digital pin/latch.
19793  This function does not perform atomic register access.
19794  Precondition:
19795  None.
19796  Parameters:
19797  index - Identifier for the device instance to be configured
19798  channel - Identifier for the Ports channel A, B, C, etc.
19799  bitPos - Possible values of PORTS_BIT_POS
19800  Returns:
19801  None.
19802  Example:
19803  <code>
19804 
19805  // Clears port pin RC4
19806  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19807 
19808  </code>
19809  Remarks:
19810  This feature may not be available on all devices. Please refer to the
19811  specific device data sheet to determine availability or use
19812  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19813  this feature is available.
19814 */
19815 
19816 void
19818  PORTS_MODULE_ID index ,
19819  PORTS_CHANNEL channel ,
19820  PORTS_BIT_POS bitPos ) ;
19821 // *****************************************************************************
19822 /* Function:
19823  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19824  PORTS_BIT_POS bitPos )
19825  Summary:
19826  Toggles the selected digital pin/latch.
19827  Description:
19828  This function toggles the selected digital pin/latch.
19829  This function does not perform atomic register access.
19830  Precondition:
19831  None.
19832  Parameters:
19833  index - Identifier for the device instance to be configured
19834  channel - Identifier for the Ports channel A, B, C, etc.
19835  bitPos - Possible values of PORTS_BIT_POS
19836  Returns:
19837  None.
19838  Example:
19839  <code>
19840 
19841  // Toggles port pin RC4
19842  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19843 
19844  </code>
19845  Remarks:
19846  This feature may not be available on all devices. Please refer to the
19847  specific device data sheet to determine availability or use
19848  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19849  this feature is available.
19850 */
19851 
19852 void
19854  PORTS_MODULE_ID index ,
19855  PORTS_CHANNEL channel ,
19856  PORTS_BIT_POS bitPos ) ;
19857 // *****************************************************************************
19858 /* Function:
19859  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19860  PORTS_BIT_POS bitPos )
19861  Summary:
19862  Makes the selected pin direction input
19863  Description:
19864  This function makes the selected pin direction as input
19865  This function does not perform atomic register access.
19866  Precondition:
19867  None.
19868  Parameters:
19869  index - Identifier for the device instance to be configured
19870  channel - Identifier for the Ports channel A, B, C, etc.
19871  bitPos - Possible values of PORTS_BIT_POS direction that has to
19872  be made input
19873  Returns:
19874  None.
19875  Example:
19876  <code>
19877 
19878  // make pin RC4 as input
19879  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19880 
19881  </code>
19882  Remarks:
19883  This feature may not be available on all devices. Please refer to the
19884  specific device data sheet to determine availability or use
19885  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19886  this feature is available.
19887 */
19888 
19889 void
19891  PORTS_MODULE_ID index ,
19892  PORTS_CHANNEL channel ,
19893  PORTS_BIT_POS bitPos ) ;
19894 // *****************************************************************************
19895 /* Function:
19896  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19897  PORTS_BIT_POS bitPos )
19898  Summary:
19899  Makes the selected pin direction output
19900  Description:
19901  This function makes the selected pin direction as output
19902  This function does not perform atomic register access.
19903  Precondition:
19904  None.
19905  Parameters:
19906  index - Identifier for the device instance to be configured
19907  channel - Identifier for the Ports channel A, B, C, etc.
19908  bitPos - Possible values of PORTS_BIT_POS direction that has to
19909  be made output
19910  Returns:
19911  None.
19912  Example:
19913  <code>
19914 
19915  // make pin RC4 as output
19916  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19917 
19918  </code>
19919  Remarks:
19920  This feature may not be available on all devices. Please refer to the
19921  specific device data sheet to determine availability or use
19922  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19923  this feature is available.
19924 */
19925 
19926 void
19928  PORTS_MODULE_ID index ,
19929  PORTS_CHANNEL channel ,
19930  PORTS_BIT_POS bitPos ) ;
19931 // *****************************************************************************
19932 /* Function:
19933  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19934  PORTS_BIT_POS bitPos )
19935  Summary:
19936  Enables the open drain functionality for the selected pin.
19937  Description:
19938  This function enables the open drain functionality for the selected pin.
19939  This function does not perform atomic register access.
19940  Precondition:
19941  None.
19942  Parameters:
19943  index - Identifier for the device instance to be configured
19944  channel - Identifier for the Ports channel A, B, C, etc.
19945  bitPos - Possible values of PORTS_BIT_POS
19946  Returns:
19947  None.
19948  Example:
19949  <code>
19950 
19951  // Enable open drain for pin RC4
19952  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19953 
19954  </code>
19955  Remarks:
19956  This feature may not be available on all devices. Please refer to the
19957  specific device data sheet to determine availability or use
19958  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19959  this feature is available.
19960 */
19961 
19962 void
19964  PORTS_MODULE_ID index ,
19965  PORTS_CHANNEL channel ,
19966  PORTS_BIT_POS bitPos ) ;
19967 // *****************************************************************************
19968 /* Function:
19969  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19970  PORTS_BIT_POS bitPos )
19971  Summary:
19972  Disables the open drain functionality for the selected pin.
19973  Description:
19974  This function disables the open drain functionality for the selected pin.
19975  This function does not perform atomic register access.
19976  Precondition:
19977  None.
19978  Parameters:
19979  index - Identifier for the device instance to be configured
19980  channel - Identifier for the Ports channel A, B, C, etc.
19981  bitPos - One of the possible values of PORTS_BIT_POS.
19982  Returns:
19983  None.
19984  Example:
19985  <code>
19986 
19987  // Disable open drain for pin RC4
19988  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19989 
19990  </code>
19991  Remarks:
19992  This feature may not be available on all devices. Please refer to the
19993  specific device data sheet to determine availability or use
19994  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19995  this feature is available.
19996 */
19997 
19998 void
20000  PORTS_MODULE_ID index ,
20001  PORTS_CHANNEL channel ,
20002  PORTS_BIT_POS bitPos ) ;
20003 // *****************************************************************************
20004 /* Function:
20005  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
20006  (
20007  PORTS_MODULE_ID index,
20008  PORTS_CHANNEL channel
20009  )
20010  Summary:
20011  Reads and returns data from the selected Latch.
20012  Description:
20013  This function reads and returns the data from the selected Latch.
20014  This function does not perform atomic register access.
20015 
20016  Precondition:
20017  None.
20018  Parameters:
20019  index - Identifier for the device instance to be configured
20020  channel - Identifier for the Ports channel A, B, C, etc.
20021  Returns:
20022  Latch read data.
20023  Example:
20024  <code>
20025  // Read latch C
20026  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
20027 
20028  </code>
20029  Remarks:
20030  For reading the Live data, PLIB_PORTS_Read function should be used.
20031 
20032  This feature may not be available on all devices. Please refer to the
20033  specific device data sheet to determine availability or use
20034  PLIB_PORTS_ExistsLatchRead in your application to determine whether
20035  this feature is available.
20036 */
20037 
20040  PORTS_MODULE_ID index ,
20041  PORTS_CHANNEL channel ) ;
20042 // *****************************************************************************
20043 /* Function:
20044  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
20045  Summary:
20046  Reads the selected digital port.
20047  Description:
20048  This function reads from the selected digital port.
20049  This function does not perform atomic register access.
20050  Precondition:
20051  None.
20052  Parameters:
20053  index - Identifier for the device instance to be configured
20054  channel - Identifier for the Ports channel A, B, C, etc.
20055  Returns:
20056  data on a port with width PORTS_DATA_TYPE
20057  Example:
20058  <code>
20059 
20060  // Read PORT C
20061  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
20062 
20063  </code>
20064  Remarks:
20065  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
20066 
20067  This feature may not be available on all devices. Please refer to the
20068  specific device data sheet to determine availability or use
20069  PLIB_PORTS_ExistsPortsRead in your application to determine whether
20070  this feature is available.
20071 */
20072 
20074  PLIB_PORTS_Read (
20075  PORTS_MODULE_ID index ,
20076  PORTS_CHANNEL channel ) ;
20077 // *****************************************************************************
20078 /* Function:
20079  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20080  PORTS_DATA_TYPE value )
20081  Summary:
20082  Writes the selected digital port/latch.
20083  Description:
20084  This function writes to the selected digital port/latch.
20085  This function does not perform atomic register access.
20086  Precondition:
20087  None.
20088  Parameters:
20089  index - Identifier for the device instance to be configured
20090  channel - Identifier for the Ports channel A, B, C, etc.
20091  value - Value to be written into a port of width PORTS_DATA_TYPE
20092  Returns:
20093  None.
20094  Example:
20095  <code>
20096 
20097  // Write 0x12 into PORT C
20098  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
20099 
20100  </code>
20101  Remarks:
20102  This feature may not be available on all devices. Please refer to the
20103  specific device data sheet to determine availability or use
20104  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20105  this feature is available.
20106 */
20107 
20108 void
20110  PORTS_MODULE_ID index ,
20111  PORTS_CHANNEL channel ,
20112  PORTS_DATA_TYPE value ) ;
20113 // *****************************************************************************
20114 /* Function:
20115  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20116  PORTS_DATA_TYPE value,
20117  PORTS_DATA_MASK mask )
20118  Summary:
20119  Sets the selected bits of the port.
20120  Description:
20121  This function performs an 'AND' operation on the value and mask parameters,
20122  and then sets the bits in the port channel that were set by the result of the
20123  'AND' operation.
20124  This function does not perform atomic register access.
20125  Precondition:
20126  None.
20127  Parameters:
20128  index - Identifier for the device instance to be configured
20129  channel - Identifier for the Ports channel A, B, C, etc.
20130  value - Consists of information about which port bit has to be
20131  set and which not
20132  mask - Identifies the bits which could be intended for setting
20133  Returns:
20134  None.
20135  Example:
20136  <code>
20137 
20138  // MY_VALUE - 0x1234
20139  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
20140 
20141  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
20142  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
20143 
20144  </code>
20145  Remarks:
20146  This feature may not be available on all devices. Please refer to the
20147  specific device data sheet to determine availability or use
20148  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20149  this feature is available.
20150 */
20151 
20152 void
20153  PLIB_PORTS_Set (
20154  PORTS_MODULE_ID index ,
20155  PORTS_CHANNEL channel ,
20156  PORTS_DATA_TYPE value ,
20157  PORTS_DATA_MASK mask ) ;
20158 // *****************************************************************************
20159 /* Function:
20160  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20161  PORTS_DATA_MASK toggleMask )
20162  Summary:
20163  Toggles the selected digital port/latch.
20164  Description:
20165  This function toggles the selected digital port/latch.
20166  This function does not perform atomic register access.
20167  Precondition:
20168  None.
20169  Parameters:
20170  index - Identifier for the device instance to be configured
20171  channel - Identifier for the Ports channel A, B, C, etc.
20172  toggleMask - Identifies the bits to be toggled
20173  Returns:
20174  None.
20175  Example:
20176  <code>
20177 
20178  // Toggles the three least significant Port C bits
20179  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20180 
20181  </code>
20182  Remarks:
20183  This feature may not be available on all devices. Please refer to the
20184  specific device data sheet to determine availability or use
20185  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20186  this feature is available.
20187 */
20188 
20189 void
20191  PORTS_MODULE_ID index ,
20192  PORTS_CHANNEL channel ,
20193  PORTS_DATA_MASK toggleMask ) ;
20194 // *****************************************************************************
20195 /* Function:
20196  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20197  PORTS_DATA_MASK clearMask )
20198  Summary:
20199  Clears the selected digital port/latch bits.
20200  Description:
20201  This function clears the selected digital port/latch bits.
20202  This function does not perform atomic register access.
20203  Precondition:
20204  None.
20205  Parameters:
20206  index - Identifier for the device instance to be configured
20207  channel - Identifier for the Ports channel A, B, C, etc.
20208  clearMask - Identifies the bits to be cleared
20209  Returns:
20210  None.
20211  Example:
20212  <code>
20213 
20214  // Clears the three least significant Port C bits
20215  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20216 
20217  </code>
20218  Remarks:
20219  This feature may not be available on all devices. Please refer to the
20220  specific device data sheet to determine availability or use
20221  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20222  this feature is available.
20223 */
20224 
20225 void
20227  PORTS_MODULE_ID index ,
20228  PORTS_CHANNEL channel ,
20229  PORTS_DATA_MASK clearMask ) ;
20230 // *****************************************************************************
20231 /* Function:
20232  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20233  PORTS_DATA_MASK mask )
20234  Summary:
20235  Makes the selected pins direction input.
20236  Description:
20237  This function makes the selected pins direction input.
20238  This function does not perform atomic register access.
20239 
20240  Precondition:
20241  None.
20242  Parameters:
20243  index - Identifier for the device instance to be configured
20244  channel - Identifier for the Ports channel A, B, C, etc.
20245  mask - Identifies the pins direction that has to be made input
20246  Returns:
20247  None.
20248  Example:
20249  <code>
20250 
20251  // Make RC0, RC1 and RC2 pins as Input
20252  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20253 
20254  </code>
20255  Remarks:
20256  This feature may not be available on all devices. Please refer to the
20257  specific device data sheet to determine availability or use
20258  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20259  this feature is available.
20260 */
20261 
20262 void
20264  PORTS_MODULE_ID index ,
20265  PORTS_CHANNEL channel ,
20266  PORTS_DATA_MASK mask ) ;
20267 // *****************************************************************************
20268 /* Function:
20269  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20270  PORTS_DATA_MASK mask )
20271  Summary:
20272  Makes the selected pins direction output.
20273  Description:
20274  This function makes the selected pins direction output.
20275  This function does not perform atomic register access.
20276  Precondition:
20277  None.
20278  Parameters:
20279  index - Identifier for the device instance to be configured
20280  channel - Identifier for the Ports channel A, B, C, etc.
20281  mask - Identifies the pins direction that has to be made output
20282  Returns:
20283  None.
20284  Example:
20285  <code>
20286 
20287  // Make RC0, RC1 and RC2 pins as Output
20288  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20289 
20290  </code>
20291  Remarks:
20292  This feature may not be available on all devices. Please refer to the
20293  specific device data sheet to determine availability or use
20294  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20295  this feature is available.
20296 */
20297 
20298 void
20300  PORTS_MODULE_ID index ,
20301  PORTS_CHANNEL channel ,
20302  PORTS_DATA_MASK mask ) ;
20303 // *****************************************************************************
20304 /* Function:
20305  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
20306  Summary:
20307  Reads the direction of the selected digital port.
20308  Description:
20309  This function reads the direction of the selected digital port.
20310  This function does not perform atomic register access.
20311  Precondition:
20312  None.
20313  Parameters:
20314  index - Identifier for the device instance to be configured
20315  channel - Identifier for the Ports channel A, B, C, etc.
20316  Returns:
20317  Direction of the selected port of type PORTS_DATA_MASK
20318  Example:
20319  <code>
20320 
20321  // Reads the direction of Port C pins
20322  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
20323 
20324  </code>
20325  Remarks:
20326  This feature may not be available on all devices. Please refer to the
20327  specific device data sheet to determine availability or use
20328  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20329  this feature is available.
20330 */
20331 
20334  PORTS_MODULE_ID index ,
20335  PORTS_CHANNEL channel ) ;
20336 // *****************************************************************************
20337 /* Function:
20338  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20339  PORTS_DATA_MASK mask )
20340  Summary:
20341  Enables the open drain functionality for the selected port pins.
20342  Description:
20343  This function enables the open drain functionality for the selected port pins.
20344  This function does not perform atomic register access.
20345  Precondition:
20346  None.
20347  Parameters:
20348  index - Identifier for the device instance to be configured
20349  channel - Identifier for the Ports channel A, B, C, etc.
20350  mask - Identifies the pins for the open drain to be enabled
20351  Returns:
20352  None.
20353  Example:
20354  <code>
20355 
20356  // Enable Open Drain for RC0, RC1 and RC2 pins
20357  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20358 
20359  </code>
20360  Remarks:
20361  This feature may not be available on all devices. Please refer to the
20362  specific device data sheet to determine availability or use
20363  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20364  this feature is available.
20365 */
20366 
20367 void
20369  PORTS_MODULE_ID index ,
20370  PORTS_CHANNEL channel ,
20371  PORTS_DATA_MASK mask ) ;
20372 // *****************************************************************************
20373 /* Function:
20374  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20375  PORTS_DATA_MASK mask )
20376  Summary:
20377  Disables the open drain functionality for the selected port.
20378  Description:
20379  This function disables the open drain functionality for the selected port.
20380  This function does not perform atomic register access.
20381 
20382  Precondition:
20383  None.
20384  Parameters:
20385  index - Identifier for the device instance to be configured
20386  channel - Identifier for the Ports channel A, B, C, etc.
20387  mask - Identifies the pins for the open drain to be disabled
20388  Returns:
20389  None.
20390  Example:
20391  <code>
20392 
20393  // Disable Open Drain for RC0, RC1 and RC2 pins
20394  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20395 
20396  </code>
20397  Remarks:
20398  This feature may not be available on all devices. Please refer to the
20399  specific device data sheet to determine availability or use
20400  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20401  this feature is available.
20402 */
20403 
20404 void
20406  PORTS_MODULE_ID index ,
20407  PORTS_CHANNEL channel ,
20408  PORTS_DATA_MASK mask ) ;
20409 // *****************************************************************************
20410 /* Function:
20411  void PLIB_PORTS_ChannelModeSelect
20412  (
20413  PORTS_MODULE_ID index,
20414  PORTS_CHANNEL channel,
20415  PORTS_DATA_MASK modeMask,
20416  PORTS_PIN_MODE mode
20417  );
20418  Summary:
20419  Enables the selected channel pins as analog or digital.
20420  Description:
20421  This function enables the selected channel pins as analog or digital.
20422  This function does not perform atomic register access.
20423  Precondition:
20424  None.
20425  Parameters:
20426  index - Identifier for the device instance to be configured
20427  channel - Port pin channel
20428  modeMask - Identifies the pins whose mode has to be modified.
20429  Modes of the pins whose corresponding bit is '1' get
20430  modified, mode of the other pins remains the same.
20431  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20432  Returns:
20433  None.
20434  Example:
20435  <code>
20436 
20437  // Make pins RC5, RC8 and RC13 Analog
20438  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
20439 
20440  </code>
20441  Remarks:
20442  This function is only available in devices with PPS. For Non-PPS devices, use the
20443  PLIB_PORTS_AnPinsModeSelect function.
20444 
20445  This feature may not be available on all devices. Please refer to the
20446  specific device data sheet to determine availability or use
20447  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
20448  this feature is available.
20449 */
20450 
20451 void
20453  PORTS_MODULE_ID index ,
20454  PORTS_CHANNEL channel ,
20455  PORTS_DATA_MASK modeMask ,
20456  PORTS_PIN_MODE mode ) ;
20457 // *****************************************************************************
20458 /* Function:
20459  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
20460  (
20461  PORTS_MODULE_ID index,
20462  PORTS_CHANNEL channel,
20463  PORTS_DATA_MASK mask
20464  );
20465  Summary:
20466  Enables Change Notice pull-up for the selected channel pins.
20467  Description:
20468  This function enables the Change Notice pull-up for the selected
20469  channel pins.
20470  This function does not perform atomic register access.
20471  Precondition:
20472  None.
20473  Parameters:
20474  index - Identifier for the device instance to be configured
20475  channel - Port pin channel
20476  mask - Identifies the pins of the pull-up to be enabled
20477  Returns:
20478  None.
20479  Example:
20480  <code>
20481 
20482  // Enable pull-up for RC5, RC8 and RC13 pins
20483  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
20484  0x2120);
20485  </code>
20486  Remarks:
20487  This function is only available in devices with PPS. For Non-PPS devices, use the
20488  PLIB_PORTS_CnPinsPullUpEnable function.
20489 
20490  This feature may not be available on all devices. Please refer to the
20491  specific device data sheet to determine availability or use
20492  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20493  determine whether this feature is available.
20494 */
20495 
20496 void
20498  PORTS_MODULE_ID index ,
20499  PORTS_CHANNEL channel ,
20500  PORTS_DATA_MASK mask ) ;
20501 // *****************************************************************************
20502 /* Function:
20503  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
20504  (
20505  PORTS_MODULE_ID index,
20506  PORTS_CHANNEL channel,
20507  PORTS_DATA_MASK mask
20508  );
20509  Summary:
20510  Disables Change Notice pull-up for the selected channel pins.
20511  Description:
20512  This function Disables the Change Notice pull-up for the selected
20513  channel pins.
20514  PLIB_PORTS_ChannelChangeNoticePullUpDisable
20515  Precondition:
20516  None.
20517  Parameters:
20518  index - Identifier for the device instance to be configured
20519  channel - Port pin channel
20520  mask - Identifies the pins of the pull-up to be disabled
20521  Returns:
20522  None.
20523  Example:
20524  <code>
20525 
20526  // Disable pull-up for RC5, RC8 and RC13 pins
20527  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
20528  0x2120);
20529  </code>
20530  Remarks:
20531  This function is only available in devices with PPS. For Non-PPS devices, use the
20532  PLIB_PORTS_CnPinsPullUpDisable function.
20533 
20534  This feature may not be available on all devices. Please refer to the
20535  specific device data sheet to determine availability or use
20536  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20537  determine whether this feature is available.
20538 */
20539 
20540 void
20542  PORTS_MODULE_ID index ,
20543  PORTS_CHANNEL channel ,
20544  PORTS_DATA_MASK mask ) ;
20545 // *****************************************************************************
20546 /* Function:
20547  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20548  (
20549  PORTS_MODULE_ID index,
20550  PORTS_CHANNEL channel,
20551  PORTS_DATA_MASK mask
20552  );
20553  Summary:
20554  Enables Change Notice pull-down for the selected channel pins.
20555  Description:
20556  This function enables the Change Notice pull-down for the selected
20557  channel pins.
20558  This function does not perform atomic register access.
20559  Precondition:
20560  None.
20561  Parameters:
20562  index - Identifier for the device instance to be configured
20563  channel - Port pin channel
20564  mask - Identifies the pins for the pull-down to be enabled
20565  Returns:
20566  None.
20567  Example:
20568  <code>
20569 
20570  // Enable pull-down for RC5, RC8 and RC13 pins
20571  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20572  0x2120);
20573  </code>
20574  Remarks:
20575  This feature may not be available on all devices. Please refer to the
20576  specific device data sheet to determine availability or use
20577  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20578  determine whether this feature is available.
20579 */
20580 
20581 void
20583  PORTS_MODULE_ID index ,
20584  PORTS_CHANNEL channel ,
20585  PORTS_DATA_MASK mask ) ;
20586 // *****************************************************************************
20587 /* Function:
20588  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20589  (
20590  PORTS_MODULE_ID index,
20591  PORTS_CHANNEL channel,
20592  PORTS_DATA_MASK mask
20593  );
20594  Summary:
20595  Disables Change Notice pull-down for the selected channel pins.
20596  Description:
20597  This function Disables the Change Notice pull-down for the selected
20598  channel pins.
20599  This function does not perform atomic register access.
20600  Precondition:
20601  None.
20602  Parameters:
20603  index - Identifier for the device instance to be configured
20604  channel - Port pin channel
20605  mask - Identifies the pins for the pull-down to be disabled
20606  Returns:
20607  None.
20608  Example:
20609  <code>
20610 
20611  // Disable pull-down for RC5, RC8 and RC13 pins
20612  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20613  0x2120);
20614  </code>
20615  Remarks:
20616  This feature may not be available on all devices. Please refer to the
20617  specific device data sheet to determine availability or use
20618  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20619  determine whether this feature is available.
20620 */
20621 
20622 void
20624  PORTS_MODULE_ID index ,
20625  PORTS_CHANNEL channel ,
20626  PORTS_DATA_MASK mask ) ;
20627 // *****************************************************************************
20628 /* Function:
20629  void PLIB_PORTS_ChannelChangeNoticeEnable
20630  (
20631  PORTS_MODULE_ID index,
20632  PORTS_CHANNEL channel,
20633  PORTS_DATA_MASK mask
20634  );
20635  Summary:
20636  Enables CN interrupt for the selected pins of a channel.
20637  Description:
20638  This function enables Change Notice interrupt for the selected port
20639  pins of a channel.
20640  This function does not perform atomic register access.
20641  Precondition:
20642  None.
20643  Parameters:
20644  index - Identifier for the device instance to be configured
20645  channel - Port pin channel
20646  mask - Identifies the pins for which change notification is
20647  to be enabled
20648  Returns:
20649  None.
20650  Example:
20651  <code>
20652 
20653  // Enable CN interrupt for RC5, RC8 and RC13 pins
20654  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20655 
20656  </code>
20657  Remarks:
20658  This function is only available in devices with PPS. For Non-PPS devices, use the
20659  PLIB_PORTS_CnPinsEnable function.
20660 
20661  This feature may not be available on all devices. Please refer to the
20662  specific device data sheet to determine availability or use
20663  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20664  determine whether this feature is available.
20665 */
20666 
20667 void
20669  PORTS_MODULE_ID index ,
20670  PORTS_CHANNEL channel ,
20671  PORTS_DATA_MASK mask ) ;
20672 // *****************************************************************************
20673 /* Function:
20674  void PLIB_PORTS_ChannelChangeNoticeDisable
20675  (
20676  PORTS_MODULE_ID index,
20677  PORTS_CHANNEL channel,
20678  PORTS_DATA_MASK mask
20679  );
20680  Summary:
20681  Disables CN interrupt for the selected pins of a channel.
20682  Description:
20683  This function Disables Change Notice interrupt for the selected port
20684  pins of a channel.
20685  This function does not perform atomic register access.
20686  Precondition:
20687  None.
20688  Parameters:
20689  index - Identifier for the device instance to be configured
20690  channel - Port pin channel
20691  mask - Identifies the pins for which change notification is
20692  to be disabled
20693  Returns:
20694  None.
20695  Example:
20696  <code>
20697 
20698  // Disable CN interrupt for RC5, RC8 and RC13 pins
20699  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20700 
20701  </code>
20702  Remarks:
20703  This function is only available in devices with PPS. For Non-PPS devices, use the
20704  PLIB_PORTS_CnPinsDisable function.
20705 
20706  This feature may not be available on all devices. Please refer to the
20707  specific device data sheet to determine availability or use
20708  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20709  determine whether this feature is available.
20710 */
20711 
20712 void
20714  PORTS_MODULE_ID index ,
20715  PORTS_CHANNEL channel ,
20716  PORTS_DATA_MASK mask ) ;
20717 // *****************************************************************************
20718 /* Function:
20719  void PLIB_PORTS_AnPinsModeSelect
20720  (
20721  PORTS_MODULE_ID index,
20722  PORTS_AN_PIN anPins,
20723  PORTS_PIN_MODE mode
20724  );
20725  Summary:
20726  Enables the selected AN pins as analog or digital.
20727  Description:
20728  This function enables the selected AN pins as analog or digital.
20729  This function does not perform atomic register access.
20730  Precondition:
20731  None.
20732  Parameters:
20733  index - Identifier for the device instance to be configured
20734  anPins - AN pins whose mode is to be changed. Multiple AN pins
20735  can be ORed.
20736  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20737  Returns:
20738  None.
20739  Example:
20740  <code>
20741 
20742  // Make pins AN5, AN8 and AN13 Analog
20743  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20744  PORTS_AN_PIN_8 |
20745  PORTS_AN_PIN_13,
20746  PORTS_PIN_MODE_ANALOG);
20747 
20748  </code>
20749  Remarks:
20750  This function is only available in devices without PPS feature. For PPS
20751  devices, use the PLIB_PORTS_ChannelModeSelect function.
20752 
20753  This feature may not be available on all devices. Please refer to the
20754  specific device data sheet to determine availability or use
20755  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20756  this feature is available.
20757 */
20758 
20759 void
20761  PORTS_MODULE_ID index ,
20762  PORTS_AN_PIN anPins ,
20763  PORTS_PIN_MODE mode ) ;
20764 // *****************************************************************************
20765 /* Function:
20766  void PLIB_PORTS_CnPinsPullUpEnable
20767  (
20768  PORTS_MODULE_ID index,
20769  PORTS_CN_PIN cnPins
20770  );
20771  Summary:
20772  Enables Change Notice pull-up for the selected channel pins.
20773  Description:
20774  This function enables the Change Notice pull-up for the selected
20775  channel pins.
20776  This function performs atomic register access.
20777  Precondition:
20778  None.
20779  Parameters:
20780  index - Identifier for the device instance to be configured
20781  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20782  can be ORed.
20783  Returns:
20784  None.
20785  Example:
20786  <code>
20787 
20788  // Enable pull-up for CN5, CN8 and CN13 pins
20789  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20790  CHANGE_NOTICE_PIN_8 |
20791  CHANGE_NOTICE_PIN_13);
20792 
20793  </code>
20794  Remarks:
20795  This function is only available in devices without PPS feature. For PPS
20796  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20797 
20798  This feature may not be available on all devices. Please refer to the
20799  specific device data sheet to determine availability or use
20800  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20801  determine whether this feature is available.
20802 */
20803 
20804 void
20806  PORTS_MODULE_ID index ,
20807  PORTS_CN_PIN cnPins ) ;
20808 // *****************************************************************************
20809 /* Function:
20810  void PLIB_PORTS_CnPinsPullUpDisable
20811  (
20812  PORTS_MODULE_ID index,
20813  PORTS_CN_PIN cnPins
20814  );
20815  Summary:
20816  Disables Change Notice pull-up for the selected channel pins.
20817  Description:
20818  This function Disables the Change Notice pull-up for the selected
20819  channel pins.
20820  This function performs atomic register access.
20821  Precondition:
20822  None.
20823  Parameters:
20824  index - Identifier for the device instance to be configured
20825  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20826  can be ORed.
20827  Returns:
20828  None.
20829  Example:
20830  <code>
20831 
20832  // Disable pull-up for CN5, CN8 and CN13 pins
20833  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20834  CHANGE_NOTICE_PIN_5 |
20835  CHANGE_NOTICE_PIN_8 |
20836  CHANGE_NOTICE_PIN_13);
20837 
20838  </code>
20839  Remarks:
20840  This function is only available in devices without PPS feature. For PPS
20841  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20842 
20843  This feature may not be available on all devices. Please refer to the
20844  specific device data sheet to determine availability or use
20845  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20846  determine whether this feature is available.
20847 */
20848 
20849 void
20851  PORTS_MODULE_ID index ,
20852  PORTS_CN_PIN cnPins ) ;
20853 // *****************************************************************************
20854 /* Function:
20855  void PLIB_PORTS_CnPinsEnable
20856  (
20857  PORTS_MODULE_ID index,
20858  PORTS_CN_PIN cnPins
20859  );
20860  Summary:
20861  Enables CN interrupt for the selected pins of a channel.
20862  Description:
20863  This function enables Change Notice interrupt for the selected port
20864  pins of a channel.
20865  This function performs atomic register access.
20866  Precondition:
20867  None.
20868  Parameters:
20869  index - Identifier for the device instance to be configured
20870  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20871  Returns:
20872  None.
20873  Example:
20874  <code>
20875 
20876  // Enable CN interrupt for CN5, CN8 and CN13 pins
20877  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20878  CHANGE_NOTICE_PIN_5 |
20879  CHANGE_NOTICE_PIN_8 |
20880  CHANGE_NOTICE_PIN_13);
20881 
20882  </code>
20883  Remarks:
20884  This function is only available in devices without PPS feature. For PPS
20885  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20886 
20887  This feature may not be available on all devices. Please refer to the
20888  specific device data sheet to determine availability or use
20889  PLIB_PORTS_ExistsPinChangeNotice in your application to
20890  determine whether this feature is available.
20891 */
20892 
20893 void
20895  PORTS_MODULE_ID index ,
20896  PORTS_CN_PIN cnPins ) ;
20897 // *****************************************************************************
20898 /* Function:
20899  void PLIB_PORTS_CnPinsDisable
20900  (
20901  PORTS_MODULE_ID index,
20902  PORTS_CN_PIN cnPins
20903  );
20904  Summary:
20905  Disables CN interrupt for the selected pins of a channel.
20906  Description:
20907  This function Disables Change Notice interrupt for the selected port
20908  pins of a channel.
20909  This function performs atomic register access.
20910  Precondition:
20911  None.
20912  Parameters:
20913  index - Identifier for the device instance to be configured
20914  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20915  Returns:
20916  None.
20917  Example:
20918  <code>
20919 
20920  // Disable CN interrupt for CN5, CN8 and CN13 pins
20921  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20922  CHANGE_NOTICE_PIN_5 |
20923  CHANGE_NOTICE_PIN_8 |
20924  CHANGE_NOTICE_PIN_13);
20925 
20926  </code>
20927  Remarks:
20928  This function is only available in devices without PPS feature. For PPS
20929  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20930 
20931  This feature may not be available on all devices. Please refer to the
20932  specific device data sheet to determine availability or use
20933  PLIB_PORTS_ExistsPinChangeNotice in your application to
20934  determine whether this feature is available.
20935 */
20936 
20937 void
20939  PORTS_MODULE_ID index ,
20940  PORTS_CN_PIN cnPins ) ;
20941 // *****************************************************************************
20942 /* Function:
20943  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20944  Summary:
20945  Global Change Notice enable.
20946  Description:
20947  This function enables the global Change Notice feature.
20948  This function performs atomic register access.
20949  Precondition:
20950  None.
20951  Parameters:
20952  index - Identifier for the device instance to be configured
20953  Returns:
20954  None.
20955  Example:
20956  <code>
20957 
20958  // Enable Change Notification
20959  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20960 
20961  </code>
20962  Remarks:
20963  This function is only available in devices without PPS. For PPS devices, use the
20964  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20965 
20966  This feature may not be available on all devices. Please refer to the
20967  specific device data sheet to determine availability or use
20968  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20969  this feature is available.
20970 */
20971 
20972 void
20974  PORTS_MODULE_ID index ) ;
20975 // *****************************************************************************
20976 /* Function:
20977  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20978  Summary:
20979  Global Change Notice disable.
20980  Description:
20981  This function disables the global Change Notice feature.
20982  Precondition:
20983  None.
20984  Parameters:
20985  index - Identifier for the device instance to be configured
20986  Returns:
20987  None.
20988  Example:
20989  <code>
20990 
20991  // Disable Change Notification
20992  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20993 
20994  </code>
20995  Remarks:
20996  This function is only available in devices without PPS. For PPS devices, use the
20997  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20998 
20999  This feature may not be available on all devices. Please refer to the
21000  specific device data sheet to determine availability or use
21001  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
21002  this feature is available.
21003 */
21004 
21005 void
21007  PORTS_MODULE_ID index ) ;
21008 // *****************************************************************************
21009 /* Function:
21010  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
21011  PORTS_CHANGE_NOTICE_PIN pinNum )
21012  Summary:
21013  Port pin Change Notice interrupt enable.
21014  Description:
21015  This function enables the port pin Change Notice feature.
21016  This function performs atomic register access.
21017  Precondition:
21018  None.
21019  Parameters:
21020  index - Identifier for the device instance to be configured
21021  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21022  Returns:
21023  None.
21024  Example:
21025  <code>
21026 
21027  // Enable Change Notice interrupt for pin CN13
21028  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
21029 
21030  </code>
21031  Remarks:
21032  This function is only available in devices without PPS. For PPS devices, use the
21033  PLIB_PORTS_PinChangeNoticePerPortEnable function.
21034 
21035  This feature may not be available on all devices. Please refer to the
21036  specific device data sheet to determine availability or use
21037  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
21038  this feature is available.
21039 */
21040 
21041 void
21043  PORTS_MODULE_ID index ,
21044  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21045 // *****************************************************************************
21046 /* Function:
21047  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
21048  PORTS_CHANGE_NOTICE_PIN pinNum )
21049  Summary:
21050  Port pin Change Notice disable.
21051  Description:
21052  This function disables the port pin Change Notice feature.
21053  This function performs atomic register access.
21054  Precondition:
21055  None.
21056  Parameters:
21057  index - Identifier for the device instance to be configured
21058  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21059  Returns:
21060  None.
21061  Example:
21062  <code>
21063 
21064  // Disable Change Notice interrupt for pin CN13
21065  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
21066 
21067  </code>
21068  Remarks:
21069  This function is only available in devices without PPS. For PPS devices, use the
21070  PLIB_PORTS_PinChangeNoticePerPortDisable function.
21071 
21072  This feature may not be available on all devices. Please refer to the
21073  specific device data sheet to determine availability or use
21074  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
21075  this feature is available.
21076 */
21077 
21078 void
21080  PORTS_MODULE_ID index ,
21081  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21082 // *****************************************************************************
21083 /* Function:
21084  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
21085  Summary:
21086  CPU Idle mode does not affect Change Notice operation.
21087  Description:
21088  This function makes sure that Change Notice feature continues working in
21089  Idle mode.
21090  This function performs atomic register access.
21091 
21092  Precondition:
21093  None.
21094  Parameters:
21095  index - Identifier for the device instance to be configured
21096  Returns:
21097  None.
21098  Example:
21099  <code>
21100 
21101  // Change notification feature will be working even when CPU goes to
21102  // Idle mode
21103  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
21104 
21105  </code>
21106  Remarks:
21107  This function is only available in devices without PPS. For PPS devices, use the
21108  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
21109 
21110  This feature may not be available on all devices. Please refer to the
21111  specific device data sheet to determine availability or use
21112  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
21113  this feature is available.
21114 */
21115 
21116 void
21118  PORTS_MODULE_ID index ) ;
21119 // *****************************************************************************
21120 /* Function:
21121  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
21122  Summary:
21123  CPU Idle halts the Change Notice operation.
21124  Description:
21125  This function halts the Change Notice operation when the CPU enters
21126  Idle mode.
21127  This function performs atomic register access.
21128  Precondition:
21129  None.
21130  Parameters:
21131  index - Identifier for the device instance to be configured
21132  Returns:
21133  None.
21134  Example:
21135  <code>
21136  // Halts the Change notification operation when CPU enters Idle mode
21137  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
21138 
21139  </code>
21140  Remarks:
21141  This function is only available in devices without PPS. For PPS devices, use the
21142  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
21143 
21144  This feature may not be available on all devices. Please refer to the
21145  specific device data sheet to determine availability or use
21146  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
21147  this feature is available.
21148 */
21149 
21150 void
21152  PORTS_MODULE_ID index ) ;
21153 // *****************************************************************************
21154 /* Function:
21155  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
21156  PORTS_CHANGE_NOTICE_PIN pinNum )
21157  Summary:
21158  Enable pull-up on input change.
21159  Description:
21160  This function enables pull-up on selected input change notification pin.
21161  This function performs atomic register access.
21162  Precondition:
21163  None.
21164  Parameters:
21165  index - Identifier for the device instance to be configured
21166  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21167  Returns:
21168  None.
21169  Example:
21170  <code>
21171 
21172  // Enable pull-up on pin CN13
21173  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
21174 
21175  </code>
21176  Remarks:
21177  This function is only available in devices without PPS. For PPS devices, use the
21178  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
21179 
21180  This feature may not be available on all devices. Please refer to the
21181  specific device data sheet to determine availability or use
21182  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
21183  this feature is available.
21184 */
21185 
21186 void
21188  PORTS_MODULE_ID index ,
21189  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21190 // *****************************************************************************
21191 /* Function:
21192  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
21193  PORTS_CHANGE_NOTICE_PIN pinNum )
21194  Summary:
21195  Disable pull-up on input change.
21196  Description:
21197  This function disables pull-up on selected input change notification pin.
21198  This function performs atomic register access.
21199  Precondition:
21200  None.
21201  Parameters:
21202  index - Identifier for the device instance to be configured
21203  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21204  Returns:
21205  None.
21206  Example:
21207  <code>
21208 
21209  // Disable pull-up on pin CN13
21210  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
21211 
21212  </code>
21213  Remarks:
21214  This function is only available in devices without PPS. For PPS devices, use the
21215  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
21216 
21217  This feature may not be available on all devices. Please refer to the
21218  specific device data sheet to determine availability or use
21219  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
21220  this feature is available.
21221 */
21222 
21223 void
21225  PORTS_MODULE_ID index ,
21226  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21227 // *****************************************************************************
21228 /* Function:
21229  void PLIB_PORTS_ChannelSlewRateSelect
21230  (
21231  PORTS_MODULE_ID index,
21232  PORTS_CHANNEL channel,
21233  PORTS_DATA_MASK channelMask,
21234  PORTS_PIN_SLEW_RATE slewRate
21235  );
21236  Summary:
21237  Selects the slew rate for selected channel pins.
21238  Description:
21239  This function selects the slew rate for selected channel pins.
21240  This function does not perform atomic register access.
21241  Precondition:
21242  None.
21243  Parameters:
21244  index - Identifier for the device instance to be configured
21245  channel - Port pin channel
21246  channelMask - Identifies the pins for which slew rate has to be modified.
21247  Slew rate of the pins which corresponding bit is "1" get
21248  modified, slew rate of the other pins remains the same.
21249  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
21250  Returns:
21251  None.
21252  Example:
21253  <code>
21254 
21255  // Make slew rate of pins RC5, RC8 and RC13 slowest
21256  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
21257  PORT_CHANNEL_C,
21258  0x2120,
21259  PORTS_PIN_SLEW_RATE_SLOWEST);
21260 
21261  </code>
21262  Remarks:
21263  This feature may not be available on all devices. Please refer to the
21264  specific device data sheet to determine availability or use
21265  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21266  whether this feature is available.
21267 */
21268 
21269 void
21271  PORTS_MODULE_ID index ,
21272  PORTS_CHANNEL channel ,
21273  PORTS_DATA_MASK channelMask ,
21274  PORTS_PIN_SLEW_RATE slewRate ) ;
21275 // *****************************************************************************
21276 /* Function:
21277 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
21278  (
21279  PORTS_MODULE_ID index,
21280  PORTS_CHANNEL channel,
21281  PORTS_BIT_POS bitPos
21282  );
21283  Summary:
21284  Gets the slew rate for selected port pin.
21285  Description:
21286  This function gets the slew rate of selected port pin.
21287  This function does not perform atomic register access.
21288  Precondition:
21289  None.
21290  Parameters:
21291  index - Identifier for the device instance to be configured
21292  channel - Port pin channel
21293  bitPos - One of the possible values of PORTS_BIT_POS.
21294  Returns:
21295  One of the possible values of PORTS_PIN_SLEW_RATE.
21296  Example:
21297  <code>
21298  PORTS_PIN_SLEW_RATE slewRate;
21299 
21300  // Get the slew rate of pin RC1
21301  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
21302 
21303  </code>
21304  Remarks:
21305  This feature may not be available on all devices. Please refer to the
21306  specific device data sheet to determine availability or use
21307  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21308  whether this feature is available.
21309 */
21310 
21311 PORTS_PIN_SLEW_RATE
21313  PORTS_MODULE_ID index ,
21314  PORTS_CHANNEL channel ,
21315  PORTS_BIT_POS bitPos ) ;
21316 // *****************************************************************************
21317 /* Function:
21318  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
21319  (
21320  PORTS_MODULE_ID index,
21321  PORTS_CHANNEL channel,
21322  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
21323  );
21324  Summary:
21325  Selects the Change Notice style for selected port channel.
21326  Description:
21327  This function selects the Change Notice style (or method) for selected port
21328  channel. It allows user to select whether the Change Notice detection will
21329  happen based on edge transition or level transition on all the CN pins of a
21330  particular channel.
21331  This function does not perform atomic register access.
21332  Precondition:
21333  None.
21334  Parameters:
21335  index - Identifier for the device instance to be configured
21336  channel - Port pin channel
21337  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21338  Returns:
21339  None.
21340  Example:
21341  <code>
21342  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
21343  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
21344  </code>
21345  Remarks:
21346  This feature may not be available on all devices. Please refer to the
21347  specific device data sheet to determine availability or use
21348  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21349  whether this feature is available.
21350 */
21351 
21352 void
21354  PORTS_MODULE_ID index ,
21355  PORTS_CHANNEL channel ,
21356  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
21357 // *****************************************************************************
21358 /* Function:
21359  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
21360  (
21361  PORTS_MODULE_ID index,
21362  PORTS_CHANNEL channel
21363  );
21364  Summary:
21365  Gets the Change Notice style for the selected port channel.
21366  Description:
21367  This function gets the Change Notice style (or method) for the selected port
21368  channel.
21369  This function does not perform atomic register access.
21370  Precondition:
21371  None.
21372  Parameters:
21373  index - Identifier for the device instance to be configured
21374  channel - Port pin channel
21375  Returns:
21376  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21377  Example:
21378  <code>
21379  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
21380  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
21381  </code>
21382  Remarks:
21383  This feature may not be available on all devices. Please refer to the
21384  specific device data sheet to determine availability or use
21385  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21386  whether this feature is available.
21387 */
21388 
21389 PORTS_CHANGE_NOTICE_METHOD
21391  PORTS_MODULE_ID index ,
21392  PORTS_CHANNEL channel ) ;
21393 // *****************************************************************************
21394 /* Function:
21395  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21396  (
21397  PORTS_MODULE_ID index,
21398  PORTS_CHANNEL channel,
21399  PORTS_DATA_MASK edgeRisingMask,
21400  PORTS_DATA_MASK edgeFallingMask
21401  );
21402  Summary:
21403  Enables selected type of edge for selected CN pins.
21404  Description:
21405  This function Enables selected type of edge (falling or rising) for
21406  selected CN pins of a port channel.
21407  This function does not perform atomic register access.
21408  Precondition:
21409  Change Notice method should be selected as
21410  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21411  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21412  Parameters:
21413  index - Identifier for the device instance to be configured
21414  channel - Port pin channel
21415  edgeRisingMask - Identifies the pins for which Change Notice has to be
21416  enabled for rising edge. Change Notice interrupt at rising
21417  edge is enabled for the pins which corresponding bit is
21418  '1', for the other pins it remains the same.
21419  edgeFallingMask - Identifies the pins for which Change Notice has to be
21420  enabled for falling edge. Change Notice interrupt at
21421  falling edge is enabled for the pins which corresponding
21422  bit is '1', for the other pins it remains the same.
21423  Returns:
21424  None.
21425  Example:
21426  <code>
21427  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
21428  // RC1 & RC5 pins.
21429  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21430  </code>
21431  Remarks:
21432  This feature is not available on all devices. Please refer to the
21433  specific device data sheet to determine availability or use
21434  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21435  whether this feature is available.
21436 */
21437 
21438 void
21440  PORTS_MODULE_ID index ,
21441  PORTS_CHANNEL channel ,
21442  PORTS_DATA_MASK edgeRisingMask ,
21443  PORTS_DATA_MASK edgeFallingMask ) ;
21444 // *****************************************************************************
21445 /* Function:
21446  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21447  (
21448  PORTS_MODULE_ID index,
21449  PORTS_CHANNEL channel,
21450  PORTS_DATA_MASK edgeRisingMask,
21451  PORTS_DATA_MASK edgeFallingMask
21452  );
21453  Summary:
21454  Disables selected type of edge for selected CN pins.
21455  Description:
21456  This function Disables selected type of edge (falling or rising) for
21457  selected CN pins of a port channel.
21458  This function does not perform atomic register access.
21459  Precondition:
21460  Change Notice method should be selected as
21461  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21462  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21463  Parameters:
21464  index - Identifier for the device instance to be configured
21465  channel - Port pin channel
21466  edgeRisingMask - Identifies the pins for which Change Notice has to be
21467  enabled for rising edge. Change notice interrupt at rising
21468  edge is enabled for the pins which corresponding bit is
21469  '1', for the other pins it remains the same.
21470  edgeFallingMask - Identifies the pins for which Change Notice has to be
21471  enabled for falling edge. Change notice interrupt at
21472  falling edge is enabled for the pins which corresponding
21473  bit is '1', for the other pins it remains the same.
21474  Returns:
21475  None.
21476  Example:
21477  <code>
21478  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
21479  // RC1 & RC5 pins.
21480  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21481  </code>
21482  Remarks:
21483  This feature is not available on all devices. Please refer to the
21484  specific device data sheet to determine availability or use
21485  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21486  whether this feature is available.
21487 */
21488 
21489 void
21491  PORTS_MODULE_ID index ,
21492  PORTS_CHANNEL channel ,
21493  PORTS_DATA_MASK edgeRisingMask ,
21494  PORTS_DATA_MASK edgeFallingMask ) ;
21495 // *****************************************************************************
21496 /* Function:
21497  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21498  (
21499  PORTS_MODULE_ID index,
21500  PORTS_CHANNEL channel,
21501  PORTS_BIT_POS bitPos,
21502  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
21503  );
21504  Summary:
21505  Check if Change Notice edge is enabled or not.
21506  This function does not perform atomic register access.
21507  Description:
21508  This function checks if selected type of Change Notice edge is enabled on a
21509  particular port pin or not.
21510  This function does not perform atomic register access.
21511  Precondition:
21512  None.
21513  Parameters:
21514  index - Identifier for the device instance to be configured
21515  channel - Port pin channel
21516  bitPos - One of the possible values of PORTS_BIT_POS.
21517  cnEdgeType - Type of the edge which has to be checked.
21518 
21519  Returns:
21520  - true - Selected type of Change Notice Edge is enabled.
21521  - false - Selected type of Change Notice Edge is not enabled.
21522 
21523  Example:
21524  <code>
21525  // Check if Change Notice at rising edge is enabled or not for pin RC1.
21526  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
21527  {
21528  // do something
21529  }
21530  </code>
21531  Remarks:
21532  This feature is not available on all devices. Please refer to the
21533  specific device data sheet to determine availability or use
21534  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21535  whether this feature is available.
21536 */
21537 
21538 bool
21540  PORTS_MODULE_ID index ,
21541  PORTS_CHANNEL channel ,
21542  PORTS_BIT_POS bitPos ,
21543  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
21544 // *****************************************************************************
21545 /* Function:
21546  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21547  (
21548  PORTS_MODULE_ID index,
21549  PORTS_CHANNEL channel,
21550  PORTS_BIT_POS bitPos
21551  );
21552  Summary:
21553  Check Change Notice edge status.
21554  Description:
21555  This function checks whether or no a Change Notice edge transition has occurred
21556  on the selected port pin.
21557  This function does not perform atomic register access.
21558  Precondition:
21559  None.
21560  Parameters:
21561  index - Identifier for the device instance to be configured
21562  channel - Port pin channel
21563  bitPos - One of the possible values of PORTS_BIT_POS
21564 
21565  Returns:
21566  - true - Change Notice edge transition has occurred
21567  - false - Change Notice edge transition has not occurred
21568 
21569  Example:
21570  <code>
21571  // Check if Change Notice edge transition has occurred for pin RC1.
21572  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21573  {
21574  // do something
21575  }
21576  </code>
21577  Remarks:
21578  This feature is not available on all devices. Please refer to the
21579  specific device data sheet to determine availability or use
21580  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21581  whether this feature is available.
21582 */
21583 
21584 bool
21586  PORTS_MODULE_ID index ,
21587  PORTS_CHANNEL channel ,
21588  PORTS_BIT_POS bitPos ) ;
21589 // *****************************************************************************
21590 // *****************************************************************************
21591 // Section: Ports Peripheral Library Exists Functions
21592 // *****************************************************************************
21593 // *****************************************************************************
21594 /* The functions below indicate the existence of the features on the device.
21595 */
21596 //******************************************************************************
21597 /* Function:
21598  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21599  Summary:
21600  Identifies whether the RemapInput feature exists on the Ports module.
21601  Description:
21602  This function identifies whether the RemapInput feature is available on the
21603  Ports module.
21604  When this function returns true, this function is supported on the device:
21605  - PLIB_PORTS_RemapInput
21606  Preconditions:
21607  None.
21608  Parameters:
21609  index - Identifier for the device instance
21610  Returns:
21611  - true - The RemapInput feature is supported on the device
21612  - false - The RemapInput feature is not supported on the device
21613  Remarks:
21614  None.
21615 */
21616 
21617 bool
21619  PORTS_MODULE_ID index ) ;
21620 //******************************************************************************
21621 /* Function:
21622  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21623  Summary:
21624  Identifies whether the RemapOutput feature exists on the Ports module.
21625  Description:
21626  This function identifies whether the RemapOutput feature is available on the
21627  Ports module.
21628  When this function returns true, this function is supported on the device:
21629  - PLIB_PORTS_RemapOutput
21630  Preconditions:
21631  None.
21632  Parameters:
21633  index - Identifier for the device instance
21634  Returns:
21635  - true - The RemapOutput feature is supported on the device
21636  - false - The RemapOutput feature is not supported on the device
21637  Remarks:
21638  None.
21639 */
21640 
21641 bool
21643  PORTS_MODULE_ID index ) ;
21644 //******************************************************************************
21645 /* Function:
21646  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21647  Summary:
21648  Identifies whether the PinMode feature exists on the Ports module.
21649  Description:
21650  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21651  feature is available on the Ports module.
21652  When this function returns true, this function is supported on the device:
21653  - PLIB_PORTS_PinModeSelect
21654  Preconditions:
21655  None.
21656  Parameters:
21657  index - Identifier for the device instance
21658  Returns:
21659  - true - The PinMode feature is supported on the device
21660  - false - The PinMode feature is not supported on the device
21661  Remarks:
21662  None.
21663 */
21664 
21665 bool
21667  PORTS_MODULE_ID index ) ;
21668 //******************************************************************************
21669 /* Function:
21670  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21671  Summary:
21672  Identifies whether the AnPinsMode feature exists on the Ports module.
21673  Description:
21674  This function identifies whether the AnPinsMode feature is available on the
21675  Ports module.
21676  When this function returns true, this function is supported on the device:
21677  - PLIB_PORTS_AnPinsModeSelect
21678  Preconditions:
21679  None.
21680  Parameters:
21681  index - Identifier for the device instance
21682  Returns:
21683  - true - The AnPinsMode feature is supported on the device
21684  - false - The AnPinsMode feature is not supported on the device
21685  Remarks:
21686  None.
21687 */
21688 
21689 bool
21691  PORTS_MODULE_ID index ) ;
21692 //******************************************************************************
21693 /* Function:
21694  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21695  Summary:
21696  Identifies whether the PortsRead feature exists on the Ports module.
21697  Description:
21698  This function identifies whether the PortsRead feature is available on the
21699  Ports module.
21700  When this function returns true, these functions are supported on the device:
21701  - PLIB_PORTS_PinGet
21702  - PLIB_PORTS_Read
21703  Preconditions:
21704  None.
21705  Parameters:
21706  index - Identifier for the device instance
21707  Returns:
21708  - true - The PortsRead feature is supported on the device
21709  - false - The PortsRead feature is not supported on the device
21710  Remarks:
21711  None.
21712 */
21713 
21714 bool
21716  PORTS_MODULE_ID index ) ;
21717 //******************************************************************************
21718 /* Function:
21719  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21720  Summary:
21721  Identifies whether the LatchRead feature exists on the Ports module.
21722  Description:
21723  This function identifies whether the LatchRead feature is available on the
21724  Ports module.
21725  When this function returns true, these functions are supported on the device:
21726  - PLIB_PORTS_PinGetLatched
21727  - PLIB_PORTS_ReadLatched
21728  Preconditions:
21729  None.
21730  Parameters:
21731  index - Identifier for the device instance
21732  Returns:
21733  - true - The LatchRead feature is supported on the device
21734  - false - The LatchRead feature is not supported on the device
21735  Remarks:
21736  None.
21737 */
21738 
21739 bool
21741  PORTS_MODULE_ID index ) ;
21742 //******************************************************************************
21743 /* Function:
21744  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21745  Summary:
21746  Identifies whether the PortsWrite feature exists on the Ports module.
21747  Description:
21748  This function identifies whether the PortsWrite feature is available on the
21749  Ports module.
21750  When this function returns true, these functions are supported on the device:
21751  - PLIB_PORTS_PinWrite
21752  - PLIB_PORTS_PinSet
21753  - PLIB_PORTS_PinClear
21754  - PLIB_PORTS_PinToggle
21755  - PLIB_PORTS_Write
21756  - PLIB_PORTS_Set
21757  - PLIB_PORTS_Toggle
21758  - PLIB_PORTS_Clear
21759  Preconditions:
21760  None.
21761  Parameters:
21762  index - Identifier for the device instance
21763  Returns:
21764  - true - The PortsWrite feature is supported on the device
21765  - false - The PortsWrite feature is not supported on the device
21766  Remarks:
21767  None.
21768 */
21769 
21770 bool
21772  PORTS_MODULE_ID index ) ;
21773 //******************************************************************************
21774 /* Function:
21775  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21776  Summary:
21777  Identifies whether the PortsDirection feature exists on the Ports module.
21778  Description:
21779  This function identifies whether the PortsDirection feature is available on the
21780  Ports module.
21781  When this function returns true, these functions are supported on the device:
21782  - PLIB_PORTS_PinDirectionInputSet
21783  - PLIB_PORTS_PinDirectionOutputSet
21784  - PLIB_PORTS_DirectionInputSet
21785  - PLIB_PORTS_DirectionOutputSet
21786  - PLIB_PORTS_DirectionGet
21787  Preconditions:
21788  None.
21789  Parameters:
21790  index - Identifier for the device instance
21791  Returns:
21792  - true - The PortsDirection feature is supported on the device
21793  - false - The PortsDirection feature is not supported on the device
21794  Remarks:
21795  None.
21796 */
21797 
21798 bool
21800  PORTS_MODULE_ID index ) ;
21801 //******************************************************************************
21802 /* Function:
21803  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21804  Summary:
21805  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21806  Description:
21807  This function identifies whether the PortsOpenDrain feature is available on
21808  the Ports module.
21809  When this function returns true, these functions are supported on the device:
21810  - PLIB_PORTS_PinOpenDrainEnable
21811  - PLIB_PORTS_PinOpenDrainDisable
21812  - PLIB_PORTS_OpenDrainEnable
21813  - PLIB_PORTS_OpenDrainDisable
21814  Preconditions:
21815  None.
21816  Parameters:
21817  index - Identifier for the device instance
21818  Returns:
21819  - true - The PortsOpenDrain feature is supported on the device
21820  - false - The PortsOpenDrain feature is not supported on the device
21821  Remarks:
21822  None.
21823 */
21824 
21825 bool
21827  PORTS_MODULE_ID index ) ;
21828 //******************************************************************************
21829 /* Function:
21830  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21831  Summary:
21832  Identifies whether the ChangeNotice feature exists on the Ports module.
21833  Description:
21834  This function identifies whether the ChangeNotice feature is available on the
21835  Ports module.
21836  When this function returns true, these functions are supported on the device:
21837  - PLIB_PORTS_ChangeNoticeEnable
21838  - PLIB_PORTS_ChangeNoticeDisable
21839  Preconditions:
21840  None.
21841  Parameters:
21842  index - Identifier for the device instance
21843  Returns:
21844  - true - The ChangeNotice feature is supported on the device
21845  - false - The ChangeNotice feature is not supported on the device
21846  Remarks:
21847  None.
21848 */
21849 
21850 bool
21852  PORTS_MODULE_ID index ) ;
21853 //******************************************************************************
21854 /* Function:
21855  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21856  Summary:
21857  Identifies whether the PinChangeNotice feature exists on the Ports module.
21858  Description:
21859  This function identifies whether the PinChangeNotice feature is available on
21860  the Ports module.
21861  When this function returns true, these functions are supported on the device:
21862  - PLIB_PORTS_PinChangeNoticeEnable
21863  - PLIB_PORTS_PinChangeNoticeDisable
21864  - PLIB_PORTS_CnPinsEnable
21865  - PLIB_PORTS_CnPinsDisable
21866  Preconditions:
21867  None.
21868  Parameters:
21869  index - Identifier for the device instance
21870  Returns:
21871  - true - The PinChangeNotice feature is supported on the device
21872  - false - The PinChangeNotice feature is not supported on the device
21873  Remarks:
21874  None.
21875 */
21876 
21877 bool
21879  PORTS_MODULE_ID index ) ;
21880 //******************************************************************************
21881 /* Function:
21882  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21883  Summary:
21884  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21885  Description:
21886  This function identifies whether the ChangeNoticeInIdle feature is available
21887  on the Ports module.
21888  When this function returns true, these functions are supported on the device:
21889  - PLIB_PORTS_ChangeNoticeInIdleEnable
21890  - PLIB_PORTS_ChangeNoticeInIdleDisable
21891  Preconditions:
21892  None.
21893  Parameters:
21894  index - Identifier for the device instance
21895  Returns:
21896  - true - The ChangeNoticeInIdle feature is supported on the device
21897  - false - The ChangeNoticeInIdle feature is not supported on the device
21898  Remarks:
21899  None.
21900 */
21901 
21902 bool
21904  PORTS_MODULE_ID index ) ;
21905 //******************************************************************************
21906 /* Function:
21907  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21908  Summary:
21909  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21910  Description:
21911  This function identifies whether the ChangeNoticePullup feature is available
21912  on the Ports module.
21913  When this function returns true, these functions are supported on the device:
21914  - PLIB_PORTS_ChangeNoticePullUpEnable
21915  - PLIB_PORTS_ChangeNoticePullUpDisable
21916  - PLIB_PORTS_CnPinsPullUpEnable
21917  - PLIB_PORTS_CnPinsPullUpDisable
21918  Preconditions:
21919  None.
21920  Parameters:
21921  index - Identifier for the device instance
21922  Returns:
21923  - true - The ChangeNoticePullup feature is supported on the device
21924  - false - The ChangeNoticePullup feature is not supported on the device
21925  Remarks:
21926  None.
21927 */
21928 
21929 bool
21931  PORTS_MODULE_ID index ) ;
21932 //******************************************************************************
21933 /* Function:
21934  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21935  Summary:
21936  Identifies whether the PinModePerPort feature exists on the Ports module.
21937  Description:
21938  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21939  feature is available on the Ports module.
21940  When this function returns true, these functions are supported on the device:
21941  - PLIB_PORTS_PinModePerPortSelect
21942  - PLIB_PORTS_ChannelModeSelect
21943  Preconditions:
21944  None.
21945  Parameters:
21946  index - Identifier for the device instance
21947  Returns:
21948  - true - The PinModePerPort feature is supported on the device
21949  - false - The PinModePerPort feature is not supported on the device
21950  Remarks:
21951  None.
21952 */
21953 
21954 bool
21956  PORTS_MODULE_ID index ) ;
21957 //******************************************************************************
21958 /* Function:
21959  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21960  Summary:
21961  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21962  Ports module.
21963  Description:
21964  This function identifies whether the ChangeNoticePullDownPerPort feature is
21965  available on the Ports module.
21966  When this function returns true, these functions are supported on the device:
21967  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21968  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21969  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21970  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21971  Preconditions:
21972  None.
21973  Parameters:
21974  index - Identifier for the device instance
21975  Returns:
21976  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21977  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21978  Remarks:
21979  None.
21980 */
21981 
21982 bool
21984  PORTS_MODULE_ID index ) ;
21985 //******************************************************************************
21986 /* Function:
21987  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21988  Summary:
21989  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21990  module.
21991  Description:
21992  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21993  on the Ports module.
21994  When this function returns true, these functions are supported on the device:
21995  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21996  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21997  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21998  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21999  Preconditions:
22000  None.
22001  Parameters:
22002  index - Identifier for the device instance
22003  Returns:
22004  - true - The ChangeNoticePullUpPerPort feature is supported on the device
22005  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
22006  Remarks:
22007  None.
22008 */
22009 
22010 bool
22012  PORTS_MODULE_ID index ) ;
22013 //******************************************************************************
22014 /* Function:
22015  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
22016  Summary:
22017  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
22018  module.
22019  Description:
22020  This function identifies whether the PinChangeNoticePerPort feature is
22021  available on the Ports module.
22022  When this function returns true, these functions are supported on the device:
22023  - PLIB_PORTS_PinChangeNoticePerPortEnable
22024  - PLIB_PORTS_PinChangeNoticePerPortDisable
22025  - PLIB_PORTS_ChannelChangeNoticeEnable
22026  - PLIB_PORTS_ChannelChangeNoticeDisable
22027  Preconditions:
22028  None.
22029  Parameters:
22030  index - Identifier for the device instance
22031  Returns:
22032  - true - The PinChangeNoticePerPort feature is supported on the device
22033  - false - The PinChangeNoticePerPort feature is not supported on the device
22034  Remarks:
22035  None.
22036 */
22037 
22038 bool
22040  PORTS_MODULE_ID index ) ;
22041 //******************************************************************************
22042 /* Function:
22043  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
22044  Summary:
22045  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
22046  module.
22047  Description:
22048  This function identifies whether the ChangeNoticePerPortTurnOn feature is
22049  available on the Ports module.
22050  When this function returns true, these functions are supported on the device:
22051  - PLIB_PORTS_ChangeNoticePerPortTurnOn
22052  - PLIB_PORTS_ChangeNoticePerPortTurnOff
22053  Preconditions:
22054  None.
22055  Parameters:
22056  index - Identifier for the device instance
22057  Returns:
22058  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
22059  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
22060  Remarks:
22061  None.
22062 */
22063 
22064 bool
22066  PORTS_MODULE_ID index ) ;
22067 //******************************************************************************
22068 /* Function:
22069  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
22070  Summary:
22071  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
22072  module.
22073  Description:
22074  This function identifies whether the ChangeNoticeInIdlePerPort feature is
22075  available on the Ports module.
22076  When this function returns true, these functions are supported on the device:
22077  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
22078  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
22079  Preconditions:
22080  None.
22081  Parameters:
22082  index - Identifier for the device instance
22083  Returns:
22084  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
22085  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
22086  Remarks:
22087  None.
22088 */
22089 
22090 bool
22092  PORTS_MODULE_ID index ) ;
22093 //******************************************************************************
22094 /* Function:
22095  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
22096  Summary:
22097  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
22098  module.
22099  Description:
22100  This function identifies whether the ChangeNoticePerPortStatus feature is
22101  available on the Ports module.
22102  When this function returns true, these functions are supported on the device:
22103  - PLIB_PORTS_ChangeNoticePerPortHasOccured
22104  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
22105  Preconditions:
22106  None.
22107  Parameters:
22108  index - Identifier for the device instance
22109  Returns:
22110  - true - The ChangeNoticePerPortStatus feature is supported on the device
22111  - false - The ChangeNoticePerPortStatus feature is not supported on the device
22112  Remarks:
22113  None.
22114 */
22115 
22116 bool
22118  PORTS_MODULE_ID index ) ;
22119 //******************************************************************************
22120 /* Function:
22121  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
22122  Summary:
22123  Identifies whether the SlewRateControl feature exists on the Ports module.
22124  Description:
22125  This function identifies whether the SlewRateControl feature is available
22126  on the Ports module.
22127  When this function returns true, these functions are supported on the device:
22128  - PLIB_PORTS_ChannelSlewRateSelect
22129  - PLIB_PORTS_PinSlewRateGet
22130  Preconditions:
22131  None.
22132  Parameters:
22133  index - Identifier for the device instance
22134  Returns:
22135  - true - The SlewRateControl feature is supported on the device
22136  - false - The SlewRateControl feature is not supported on the device
22137  Remarks:
22138  None.
22139 */
22140 
22141 bool
22143  PORTS_MODULE_ID index ) ;
22144 //******************************************************************************
22145 /* Function:
22146  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
22147  Summary:
22148  Identifies whether the ChannelChangeNoticeMethod feature exists on the
22149  Ports module.
22150  Description:
22151  This function identifies whether the ChannelChangeNoticeMethod feature is
22152  available on the Ports module.
22153  When this function returns true, these functions are supported on the device:
22154  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
22155  - PLIB_PORTS_ChannelChangeNoticeMethodGet
22156  Preconditions:
22157  None.
22158  Parameters:
22159  index - Identifier for the device instance
22160  Returns:
22161  - true - The ChannelChangeNoticeMethod feature is supported on the device
22162  - false - The ChannelChangeNoticeMethod feature is not supported on the device
22163  Remarks:
22164  None.
22165 */
22166 
22167 bool
22169  PORTS_MODULE_ID index ) ;
22170 //******************************************************************************
22171 /* Function:
22172  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
22173  Summary:
22174  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
22175  module.
22176  Description:
22177  This function identifies whether the ChangeNoticeEdgeControl feature is
22178  available on the Ports module.
22179  When this function returns true, these functions are supported on the device:
22180  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
22181  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
22182  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
22183  Preconditions:
22184  None.
22185  Parameters:
22186  index - Identifier for the device instance
22187  Returns:
22188  - true - The ChangeNoticeEdgeControl feature is supported on the device
22189  - false - The ChangeNoticeEdgeControl feature is not supported on the device
22190  Remarks:
22191  None.
22192 */
22193 
22194 bool
22196  PORTS_MODULE_ID index ) ;
22197 //******************************************************************************
22198 /* Function:
22199  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
22200  Summary:
22201  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
22202  module.
22203  Description:
22204  This function identifies whether the ChangeNoticeEdgeStatus feature is available
22205  on the Ports module.
22206  When this function returns true, this function is supported on the device:
22207  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
22208  Preconditions:
22209  None.
22210  Parameters:
22211  index - Identifier for the device instance
22212  Returns:
22213  - true - The ChangeNoticeEdgeStatus feature is supported on the device
22214  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
22215  Remarks:
22216  None.
22217 */
22218 
22219 bool
22221  PORTS_MODULE_ID index ) ;
22222 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
22223 /*******************************************************************************
22224  Ports Peripheral Library Compatibility Header
22225  Company:
22226  Microchip Technology Inc.
22227  File Name:
22228  plib_ports_compatibility.h
22229  Summary:
22230  Ports Peripheral Library Interface header for backward compatibility.
22231  Description:
22232  This header file contains the definitions of the functions which are
22233  supported for backward compatibility only. These will be deprecated later.
22234 *******************************************************************************/
22235 // DOM-IGNORE-BEGIN
22236 /*******************************************************************************
22237 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
22238 Microchip licenses to you the right to use, modify, copy and distribute
22239 Software only when embedded on a Microchip microcontroller or digital signal
22240 controller that is integrated into your product or third party product
22241 (pursuant to the sublicense terms in the accompanying license agreement).
22242 You should refer to the license agreement accompanying this Software for
22243 additional information regarding your rights and obligations.
22244 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
22245 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
22246 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
22247 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
22248 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
22249 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
22250 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
22251 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
22252 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
22253 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
22254 *******************************************************************************/
22255 // DOM-IGNORE-END
22256 #ifndef _PLIB_PORTS_COMPATIBILITY_H
22257 #define _PLIB_PORTS_COMPATIBILITY_H
22258 #include <stdint.h>
22259 #include <stddef.h>
22260 // *****************************************************************************
22261 /* Function:
22262  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
22263  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
22264  Summary:
22265  checks the status of change on the pin
22266  Description:
22267  This function checks if the change has occurred on the given pin or not.
22268  Precondition:
22269  None.
22270  Parameters:
22271  index - Identifier for the device instance to be configured
22272  channel - Port pin channel
22273  bitPos - Position in the PORT pins
22274  Returns:
22275  None.
22276  Example:
22277  <code>
22278 
22279  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
22280  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
22281  {
22282  //do something
22283  }
22284 
22285  </code>
22286  Remarks:
22287  This feature may not be available on all devices. Please refer to the
22288  specific device data sheet to determine availability or use
22289  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
22290  whether this feature is available.
22291 
22292  This function will be deprecated later.
22293 */
22294 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
22295  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
22296 /*******************************************************************************
22297  End of File
22298 */
22299 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
22300 /* CLOSE_FILE Include File */
22301 
22302 //DOM-IGNORE-BEGIN
22303 //DOM-IGNORE-END
22304  // #ifndef _PLIB_PORTS_H
22305 /*******************************************************************************
22306  End of File
22307 */
22308 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
22309 /* CLOSE_FILE Include File */
22310 
22311 #include "system/int/sys_int.h"
22312 // *****************************************************************************
22313 // *****************************************************************************
22314 // Section: SYS PORTS Data Types
22315 // *****************************************************************************
22316 // *****************************************************************************
22317 // *****************************************************************************
22318 /* SYS PORTS PULLUP status
22319  Summary:
22320  Provides the pull-up and pull-down status.
22321  Description:
22322  These constants provide the pull-up or pull-down status definitions.
22323  Remarks:
22324  None.
22325 */
22326 
22327 typedef
22328  enum
22329  {
22330  /* PULLUP Disable */
22332  /*DOM-IGNORE-BEGIN*/
22333  = 0 /*DOM-IGNORE-END*/
22334  ,
22335  /* PULLUP Enable */
22337  /*DOM-IGNORE-BEGIN*/
22338  = 1 /*DOM-IGNORE-END*/
22339  ,
22341 // *****************************************************************************
22342 /* SYS PORTS PIN DIRECTION
22343  Summary:
22344  Defines the direction of the port pins.
22345  Description:
22346  These constants provide the port pin direction definitions.
22347  Remarks:
22348  None.
22349 */
22350 
22351 typedef
22352  enum
22353  {
22354  /* Direction as output */
22356  /*DOM-IGNORE-BEGIN*/
22357  = 0 /*DOM-IGNORE-END*/
22358  ,
22359  /* Direction as input */
22361  /*DOM-IGNORE-BEGIN*/
22362  = 1 /*DOM-IGNORE-END*/
22363  ,
22365 
22366 typedef
22367  enum
22368  {
22371  // #ifndef _SYS_PORTS_DEFINITIONS_H
22372 /*******************************************************************************
22373  End of File
22374 */
22375 
22376 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
22377 /* CLOSE_FILE Include File */
22378 
22379 // DOM-IGNORE-BEGIN
22380 // DOM-IGNORE-END
22381 // *****************************************************************************
22382 // *****************************************************************************
22383 // Section: SYS PorTS Module Initialization Routine
22384 // *****************************************************************************
22385 // *****************************************************************************
22386 // *****************************************************************************
22387 /* Function:
22388  void SYS_PORTS_Initialize()
22389  Summary:
22390  Initializes PORT Pins/Channels.
22391  <p><b>Implementation:</b> Static/Dynamic</p>
22392  Description:
22393  This function initializes different port pins/channels to the desired state.
22394  It also remaps the pins to the desired specific function.
22395  Precondition:
22396  None.
22397  Parameters:
22398  None.
22399  Returns:
22400  None.
22401  Example:
22402  <code>
22403  SYS_PORTS_Initialize();
22404  </code>
22405  Remarks:
22406  This API must be be called at the time of system initialization to
22407  initialize the ports pins.
22408 */
22409 
22410 void
22412 // *****************************************************************************
22413 // *****************************************************************************
22414 // Section: SYS PORTS CONTROL Routines
22415 // *****************************************************************************
22416 // *****************************************************************************
22417 // *****************************************************************************
22418 /* Function:
22419  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22420  Summary:
22421  Reads the data from the I/O port.
22422  <p><b>Implementation:</b> Dynamic</p>
22423  Description:
22424  This function reads the data from the I/O port.
22425  Preconditions:
22426  The direction of the port to be set as input.
22427  Parameters:
22428  index - Identifier for the device instance to be configured
22429  channel - Identifier for the PORT channel: A, B, C, etc.
22430  Returns:
22431  Returns the data read from the port.
22432  Example:
22433  <code>
22434  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22435  // application developer.
22436  PORTS_DATA_TYPE readData;
22437  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
22438  </code>
22439  Remarks:
22440  None.
22441 */
22442 
22444  SYS_PORTS_Read (
22445  PORTS_MODULE_ID index ,
22446  PORTS_CHANNEL channel ) ;
22447 // *****************************************************************************
22448 /* Function:
22449  void SYS_PORTS_Write( PORTS_MODULE_ID index,
22450  PORTS_CHANNEL channel,
22451  PORTS_DATA_TYPE value )
22452  Summary:
22453  Writes the data to the I/O port.
22454  <p><b>Implementation:</b> Dynamic</p>
22455  Description:
22456  This function writes the data to the I/O port.
22457  Preconditions:
22458  The direction of the port to be set as output.
22459  Parameters:
22460  index - Identifier for the device instance to be configured
22461  channel - Identifier for the PORT channel: A, B, C, etc.
22462  value - Value to be written into a port of width PORTS_DATA_TYPE
22463  Returns:
22464  None.
22465  Example:
22466  <code>
22467  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22468  // application developer.
22469  PORTS_DATA_TYPE writeData;
22470  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
22471  </code>
22472  Remarks:
22473  None.
22474 */
22475 
22476 void
22477  SYS_PORTS_Write (
22478  PORTS_MODULE_ID index ,
22479  PORTS_CHANNEL channel ,
22480  PORTS_DATA_TYPE value ) ;
22481 // *****************************************************************************
22482 /* Function:
22483  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22484  Summary:
22485  Reads the data driven on the I/O port.
22486  <p><b>Implementation:</b> Dynamic</p>
22487  Description:
22488  This function reads the data driven on the I/O port.
22489  Preconditions:
22490  The direction of the port to be set as output.
22491  Parameters:
22492  index - Identifier for the device instance to be configured
22493  channel - Identifier for the PORT channel: A, B, C, etc.
22494  Returns:
22495  Returns the data driven on the port.
22496  Example:
22497  <code>
22498  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22499  // application developer.
22500  PORTS_DATA_TYPE drivenData;
22501  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22502  </code>
22503  Remarks:
22504  None.
22505 */
22506 
22509  PORTS_MODULE_ID index ,
22510  PORTS_CHANNEL channel ) ;
22511 // *****************************************************************************
22512 /* Function:
22513  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22514  PORTS_DATA_TYPE value,
22515  PORTS_DATA_MASK mask )
22516  Summary:
22517  Sets the selected digital port/latch based on the mask.
22518  <p><b>Implementation:</b> Dynamic</p>
22519  Description:
22520  This function Sets the selected digital port/latch relative to the mask.
22521  This function "AND" value and mask parameters and then set the bits
22522  in the port channel that were set in the result of the ANDing operation.
22523  Preconditions:
22524  None.
22525  Parameters:
22526  index - Identifier for the device instance to be configured
22527  channel - Identifier for the PORT channel: A, B, C, etc.
22528  value - Consists of information about which port bit has to be set
22529  mask - Identifies the bits which could be intended for setting
22530  Returns:
22531  None.
22532  Example:
22533  <code>
22534  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22535  // application developer.
22536  // MY_VALUE - 0x1234
22537  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22538  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
22539  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
22540  </code>
22541  Remarks:
22542  Not all features are available on all devices. Refer to the specific device
22543  data sheet for availability.
22544 */
22545 
22546 void
22547  SYS_PORTS_Set (
22548  PORTS_MODULE_ID index ,
22549  PORTS_CHANNEL channel ,
22550  PORTS_DATA_TYPE value ,
22551  PORTS_DATA_MASK mask ) ;
22552 // *****************************************************************************
22553 /* Function:
22554  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22555  PORTS_DATA_MASK clearMask )
22556  Summary:
22557  Clears the selected digital port.
22558  <p><b>Implementation:</b> Dynamic</p>
22559  Description:
22560  This function clears the selected digital port.
22561  Preconditions:
22562  None.
22563  Parameters:
22564  index - Identifier for the device instance to be configured
22565  channel - Identifier for the PORT channel: A, B, C, etc.
22566  clearMask - Identifies the bits to be cleared
22567  Returns:
22568  None.
22569  Example:
22570  <code>
22571  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22572  // application developer.
22573  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22574  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22575  </code>
22576  Remarks:
22577  Not all features are available on all devices. Refer to the specific device
22578  data sheet for availability.
22579 */
22580 
22581 void
22582  SYS_PORTS_Clear (
22583  PORTS_MODULE_ID index ,
22584  PORTS_CHANNEL channel ,
22585  PORTS_DATA_MASK clearMask ) ;
22586 // *****************************************************************************
22587 /* Function:
22588  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22589  SYS_PORTS_PIN_DIRECTION pinDir,
22590  PORTS_CHANNEL channel,
22591  PORTS_DATA_MASK mask )
22592  Summary:
22593  Enables the direction for the selected port.
22594  <p><b>Implementation:</b> Dynamic</p>
22595  Description:
22596  This function enables the direction for the selected port.
22597  Preconditions:
22598  None.
22599  Parameters:
22600  index - Identifier for the device instance to be configured
22601  pinDir - Pin direction
22602  channel - Identifier for the PORT channel: A, B, C, etc.
22603  mask - Mask for the direction of width PORTS_DATA_MASK
22604  Returns:
22605  None
22606  Example:
22607  <code>
22608  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22609  // application developer.
22610  SYS_PORTS_PIN_DIRECTION pinDir;
22611  pinDir = SYS_PORTS_DIRECTION_INPUT;
22612  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22613  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22614  </code>
22615  Remarks:
22616  None.
22617 */
22618 
22619 void
22621  PORTS_MODULE_ID index ,
22622  SYS_PORTS_PIN_DIRECTION pinDir ,
22623  PORTS_CHANNEL channel ,
22624  PORTS_DATA_MASK mask ) ;
22625 // *****************************************************************************
22626 /* Function:
22627  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22628  Summary:
22629  Reads the direction for the selected port.
22630  <p><b>Implementation:</b> Dynamic</p>
22631  Description:
22632  This function reads the direction for the selected port.
22633  Preconditions:
22634  None.
22635  Parameters:
22636  index - Identifier for the device instance to be configured
22637  channel - Identifier for the PORT channel: A, B, C, etc.
22638  Returns:
22639  Direction of the port.
22640  Example:
22641  <code>
22642  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22643  // application developer.
22644  PORTS_DATA_MASK value;
22645  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22646  </code>
22647  Remarks:
22648  None.
22649 */
22650 
22653  PORTS_MODULE_ID index ,
22654  PORTS_CHANNEL channel ) ;
22655 // *****************************************************************************
22656 /* Function:
22657  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22658  PORTS_DATA_MASK toggleMask )
22659  Summary:
22660  Toggles the selected digital port pins.
22661  <p><b>Implementation:</b> Dynamic</p>
22662  Description:
22663  This function toggles the selected digital port pins.
22664  Preconditions:
22665  None.
22666  Parameters:
22667  index - Identifier for the device instance to be configured
22668  channel - Identifier for the PORT channel: A, B, C, etc.
22669  toggleMask - Identifies the bits to be toggled
22670  Returns:
22671  None.
22672  Example:
22673  <code>
22674  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22675  // application developer.
22676  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22677  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22678  </code>
22679  Remarks:
22680  None.
22681 */
22682 
22683 void
22685  PORTS_MODULE_ID index ,
22686  PORTS_CHANNEL channel ,
22687  PORTS_DATA_MASK toggleMask ) ;
22688 // *****************************************************************************
22689 /* Function:
22690  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22691  PORTS_DATA_MASK mask )
22692  Summary:
22693  Enables the open-drain functionality for the selected port.
22694  <p><b>Implementation:</b> Dynamic</p>
22695  Description:
22696  This function enables the open-drain functionality for the selected port.
22697  Preconditions:
22698  None.
22699  Parameters:
22700  index - Identifier for the device instance to be configured
22701  channel - Identifier for the PORT channel: A, B, C, etc.
22702  mask - Mask of type PORTS_DATA_MASK
22703  Returns:
22704  None.
22705  Example:
22706  <code>
22707  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22708  // application developer.
22709  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22710  </code>
22711  Remarks:
22712  Not all features are available on all devices. Refer to the specific device
22713  data sheet for availability.
22714 */
22715 
22716 void
22718  PORTS_MODULE_ID index ,
22719  PORTS_CHANNEL channel ,
22720  PORTS_DATA_MASK mask ) ;
22721 // *****************************************************************************
22722 /* Function:
22723  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22724  PORTS_DATA_MASK mask )
22725  Summary:
22726  Disables the open-drain functionality for the selected port.
22727  <p><b>Implementation:</b> Dynamic</p>
22728  Description:
22729  This function disables the open-drain functionality for the selected port.
22730  Preconditions:
22731  None.
22732  Parameters:
22733  index - Identifier for the device instance to be configured
22734  channel - Identifier for the PORT channel: A, B, C, etc.
22735  mask - Mask of type PORTS_DATA_MASK
22736  Returns:
22737  None.
22738  Example:
22739  <code>
22740  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22741  // application developer.
22742  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22743  </code>
22744  Remarks:
22745  Not all features are available on all devices. Refer to the specific device
22746  data sheet for availability.
22747 */
22748 
22749 void
22751  PORTS_MODULE_ID index ,
22752  PORTS_CHANNEL channel ,
22753  PORTS_DATA_MASK mask ) ;
22754 // *****************************************************************************
22755 /* Function:
22756  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22757  (
22758  PORTS_MODULE_ID index,
22759  PORTS_CHANNEL channel
22760  )
22761  Summary:
22762  Reads the interrupt status from the I/O port.
22763  <p><b>Implementation:</b> Dynamic</p>
22764  Description:
22765  This function reads the interrupt status from the I/O port.
22766  Preconditions:
22767  The interrupts should have been configured.
22768  Parameters:
22769  index - Identifier for the device instance to be configured
22770  channel - Identifier for the PORT channel: A, B, C, etc.
22771  Returns:
22772  Returns the interrupt status of the port channel.
22773  Example:
22774  <code>
22775  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22776  // application developer.
22777  PORTS_DATA_TYPE channelStatus;
22778  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22779  </code>
22780  Remarks:
22781  None.
22782 */
22783 
22786  PORTS_MODULE_ID index ,
22787  PORTS_CHANNEL channel ) ;
22788 // *****************************************************************************
22789 // *****************************************************************************
22790 // Section: SYS PORT PINS REMAPING Routines
22791 // *****************************************************************************
22792 // *****************************************************************************
22793 // *****************************************************************************
22794 /* Function:
22795  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22796  PORTS_REMAP_INPUT_FUNCTION function,
22797  PORTS_REMAP_INPUT_PIN remapPin )
22798  Summary:
22799  Input/Output (I/O) function remapping.
22800  <p><b>Implementation:</b> Dynamic</p>
22801  Description:
22802  This function controls the I/O function remapping.
22803  Precondition:
22804  None.
22805  Parameters:
22806  index - Identifier for the device instance to be configured
22807  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22808  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22809  Returns:
22810  None.
22811  Example:
22812  <code>
22813  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22814  // application developer.
22815  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22816  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22817  </code>
22818  Remarks:
22819  This feature may not be available on all devices. Please refer to the
22820  specific device data sheet to determine availability or use
22821  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22822  this feature is available.
22823 */
22824 
22825 void
22827  PORTS_MODULE_ID index ,
22828  PORTS_REMAP_INPUT_FUNCTION function ,
22829  PORTS_REMAP_INPUT_PIN remapPin ) ;
22830 // *****************************************************************************
22831 /* Function:
22832  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22833  PORTS_REMAP_OUTPUT_FUNCTION function,
22834  PORTS_REMAP_OUTPUT_PIN remapPin )
22835  Summary:
22836  Input/Output (I/O) function remapping.
22837  <p><b>Implementation:</b> Dynamic</p>
22838  Description:
22839  This function controls the I/O function remapping.
22840  Precondition:
22841  None.
22842  Parameters:
22843  index - Identifier for the device instance to be configured
22844  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22845  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22846  Returns:
22847  None.
22848  Example:
22849  <code>
22850  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22851  // application developer.
22852  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22853  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22854  </code>
22855  Remarks:
22856  This feature may not be available on all devices. Please refer to the
22857  specific device data sheet to determine availability or use
22858  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22859  this feature is available.
22860 */
22861 
22862 void
22864  PORTS_MODULE_ID index ,
22865  PORTS_REMAP_OUTPUT_FUNCTION function ,
22866  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22867 // *****************************************************************************
22868 // *****************************************************************************
22869 // Section: SYS Change Notification Pins Routines
22870 // *****************************************************************************
22871 // *****************************************************************************
22872 // *****************************************************************************
22873 /* Function:
22874  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22875  Summary:
22876  Globally enables the change notification for the selected port.
22877  <p><b>Implementation:</b> Dynamic</p>
22878  Description:
22879  This function globally enables the change notification for the selected port.
22880  Preconditions:
22881  None.
22882  Parameters:
22883  None.
22884  Returns:
22885  None.
22886  Example:
22887  <code>
22888  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22889  // application developer.
22890  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22891  </code>
22892  Remarks:
22893  Not all features are available on all devices. Refer to the specific device
22894  data sheet for availability.
22895 */
22896 
22897 void
22899  PORTS_MODULE_ID index ) ;
22900 // *****************************************************************************
22901 /* Function:
22902  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22903  Summary:
22904  Globally disables the change notification for the selected port.
22905  <p><b>Implementation:</b> Dynamic</p>
22906  Description:
22907  This function globally disables the change notification for the selected port.
22908  Preconditions:
22909  None.
22910  Parameters:
22911  None.
22912  Returns:
22913  None.
22914  Example:
22915  <code>
22916  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22917  // application developer.
22918  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22919  </code>
22920  Remarks:
22921  Not all features are available on all devices. Refer to the specific device
22922  data sheet for availability.
22923 */
22924 
22925 void
22927  PORTS_MODULE_ID index ) ;
22928 // *****************************************************************************
22929 /* Function:
22930  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22931  PORTS_CHANGE_NOTICE_PIN pinNum,
22932  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22933  Summary:
22934  Enables the change notification for the selected port.
22935  <p><b>Implementation:</b> Dynamic</p>
22936  Description:
22937  This function enables the change notification for the selected port.
22938  Preconditions:
22939  None.
22940  Parameters:
22941  index - Identifier for the device instance to be configured
22942  value - Pull-up enable or disable value
22943  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22944  Returns:
22945  None.
22946  Example:
22947  <code>
22948  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22949  // application developer.
22950  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22951  PORTS_CHANGE_NOTICE_PIN pinNum;
22952  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22953  </code>
22954  Remarks:
22955  Not all features are available on all devices. Refer to the specific device
22956  data sheet for availability.
22957 */
22958 
22959 void
22961  PORTS_MODULE_ID index ,
22962  PORTS_CHANGE_NOTICE_PIN pinNum ,
22964 // *****************************************************************************
22965 /* Function:
22966  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22967  PORTS_CHANGE_NOTICE_PIN pinNum )
22968  Summary:
22969  Disables the change notification for the selected port.
22970  <p><b>Implementation:</b> Dynamic</p>
22971  Description:
22972  This function disables the change notification for the selected port.
22973  Preconditions:
22974  None.
22975  Parameters:
22976  index - Identifier for the device instance to be configured
22977  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22978  Returns:
22979  None.
22980  Example:
22981  <code>
22982  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22983  // application developer.
22984  PORTS_CHANGE_NOTICE_PIN pinNum;
22985  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22986  </code>
22987  Remarks:
22988  Not all features are available on all devices. Refer to the specific device
22989  data sheet for availability.
22990 */
22991 
22992 void
22994  PORTS_MODULE_ID index ,
22995  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22996 // *****************************************************************************
22997 /* Function:
22998  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22999  Summary:
23000  Enables the change notification for the selected port in Sleep or Idle mode.
23001  <p><b>Implementation:</b> Dynamic</p>
23002  Description:
23003  This function enables the change notification for the selected port in Sleep
23004  or Idle mode.
23005  Preconditions:
23006  None.
23007  Parameters:
23008  None.
23009  Returns:
23010  None.
23011  Example:
23012  <code>
23013  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23014  // application developer.
23015  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
23016  </code>
23017  Remarks:
23018  Not all features are available on all devices. Refer to the specific device
23019  data sheet for availability.
23020 */
23021 
23022 void
23024  PORTS_MODULE_ID index ) ;
23025 // *****************************************************************************
23026 /* Function:
23027  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
23028  Summary:
23029  Disables the change notification for the selected port in Sleep or Idle mode.
23030  <p><b>Implementation:</b> Dynamic</p>
23031  Description:
23032  This function disables the change notification for the selected port in Sleep
23033  or Idle mode.
23034  Preconditions:
23035  None.
23036  Parameters:
23037  None.
23038  Returns:
23039  None.
23040  Example:
23041  <code>
23042  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23043  // application developer.
23044  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
23045  </code>
23046  Remarks:
23047  Not all features are available on all devices. Refer to the specific device
23048  data sheet for availability.
23049 */
23050 
23051 void
23053  PORTS_MODULE_ID index ) ;
23054 // *****************************************************************************
23055 /* Function:
23056  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
23057  PORTS_CHANGE_NOTICE_PIN pinNum )
23058  Summary:
23059  Enables a weak pull-up on the change notification pin.
23060  <p><b>Implementation:</b> Dynamic</p>
23061  Description:
23062  This function enables a weak pull-up on the change notification pin.
23063  Preconditions:
23064  None.
23065  Parameters:
23066  index - Identifier for the device instance to be configured
23067  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
23068  Returns:
23069  None.
23070  Example:
23071  <code>
23072  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23073  // application developer.
23074  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
23075  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
23076  </code>
23077  Remarks:
23078  Not all features are available on all devices. Refer to the specific device
23079  data sheet for availability.
23080 */
23081 
23082 void
23084  PORTS_MODULE_ID index ,
23085  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
23086 // *****************************************************************************
23087 /* Function:
23088  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
23089  PORTS_CHANGE_NOTICE_PIN pinNum )
23090  Summary:
23091  Disables a weak pull-up on the change notification pin.
23092  <p><b>Implementation:</b> Dynamic</p>
23093  Description:
23094  This function Disables a weak pull-up on the change notification pin.
23095  Preconditions:
23096  None.
23097  Parameters:
23098  index - Identifier for the device instance to be configured
23099  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
23100  Returns:
23101  None.
23102  Example:
23103  <code>
23104  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23105  // application developer.
23106  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
23107  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
23108  </code>
23109  Remarks:
23110  Not all features are available on all devices. Refer to the specific device
23111  data sheet for availability.
23112 */
23113 
23114 void
23116  PORTS_MODULE_ID index ,
23117  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
23118 // *****************************************************************************
23119 // *****************************************************************************
23120 // Section: SYS PORT PINS Control Routines
23121 // *****************************************************************************
23122 // *****************************************************************************
23123 // *****************************************************************************
23124 /* Function:
23125  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
23126  PORTS_ANALOG_PIN pin,
23127  PORTS_PIN_MODE mode)
23128  Summary:
23129  Enables the selected pin as analog or digital.
23130  <p><b>Implementation:</b> Dynamic</p>
23131  Description:
23132  This function enables the selected pin as analog or digital.
23133  Preconditions:
23134  None.
23135  Parameters:
23136  index - Identifier for the device instance to be configured
23137  pin - Possible values of PORTS_ANALOG_PIN
23138  mode - Possible values of PORTS_PIN_MODE
23139  Returns:
23140  None.
23141  Example:
23142  <code>
23143  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23144  // application developer.
23145  // MY_PIN - PORTS_ANALOG_PIN_AN0
23146  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
23147  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
23148  </code>
23149  Remarks:
23150  Not all features are available on all devices. Refer to the specific device
23151  data sheet for availability.
23152 */
23153 
23154 void
23156  PORTS_MODULE_ID index ,
23157  PORTS_ANALOG_PIN pin ,
23158  PORTS_PIN_MODE mode ) ;
23159 // *****************************************************************************
23160 /* Function:
23161  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
23162  PORTS_CHANNEL channel,
23163  PORTS_BIT_POS bitPos
23164  bool value )
23165  Summary:
23166  Writes the selected digital pin.
23167  <p><b>Implementation:</b> Dynamic</p>
23168  Description:
23169  This function writes the selected digital pin.
23170  Preconditions:
23171  None.
23172  Parameters:
23173  index - Identifier for the device instance to be configured
23174  channel - Identifier for the PORT channel: A, B, C, etc.
23175  bitPos - Possible values of PORTS_BIT_POS
23176  value - Value to be written to the specific pin/latch:
23177  - true - Sets the bit
23178  - false - Clears the bit
23179  Returns:
23180  None.
23181  Example:
23182  <code>
23183  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23184  // application developer.
23185  // MY_PINNUM - PORTS_PIN_10
23186  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
23187  </code>
23188  Remarks:
23189  Not all features are available on all devices. Refer to the specific device
23190  data sheet for availability.
23191 */
23192 
23193 void
23195  PORTS_MODULE_ID index ,
23196  PORTS_CHANNEL channel ,
23197  PORTS_BIT_POS bitPos ,
23198  bool value ) ;
23199 // *****************************************************************************
23200 /* Function:
23201  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
23202  PORTS_CHANNEL channel,
23203  PORTS_BIT_POS bitPos )
23204  Summary:
23205  Reads the data driven on the selected digital pin.
23206  <p><b>Implementation:</b> Dynamic</p>
23207  Description:
23208  This function reads the data driven on the selected
23209  digital output pin.
23210  Preconditions:
23211  None.
23212  Parameters:
23213  index - Identifier for the device instance to be configured
23214  channel - Identifier for the PORT channel: A, B, C, etc.
23215  bitPos - Possible values of PORTS_BIT_POS
23216  Returns:
23217  The status of the data driven on the port pin.
23218  Example:
23219  <code>
23220  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23221  // application developer.
23222  // MY_PINNUM - PORTS_PIN_10
23223  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23224  </code>
23225  Remarks:
23226  Not all features are available on all devices. Refer to the specific device
23227  data sheet for availability.
23228 */
23229 
23230 bool
23232  PORTS_MODULE_ID index ,
23233  PORTS_CHANNEL channel ,
23234  PORTS_BIT_POS bitPos ) ;
23235 // *****************************************************************************
23236 /* Function:
23237  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
23238  PORTS_CHANNEL channel,
23239  PORTS_BIT_POS bitPos )
23240  Summary:
23241  Reads the selected digital pin.
23242  <p><b>Implementation:</b> Dynamic</p>
23243  Description:
23244  This function reads the selected digital pin, not the Latch.
23245  Preconditions:
23246  None.
23247  Parameters:
23248  index - Identifier for the device instance to be configured
23249  channel - Identifier for the PORT channel: A, B, C, etc.
23250  bitPos - Possible values of PORTS_BIT_POS
23251  Returns:
23252  The status of the port pin.
23253  Example:
23254  <code>
23255  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23256  // application developer.
23257  // MY_PINNUM - PORTS_PIN_10
23258  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23259  </code>
23260  Remarks:
23261  Not all features are available on all devices. Refer to the specific device
23262  data sheet for availability.
23263 */
23264 
23265 bool
23267  PORTS_MODULE_ID index ,
23268  PORTS_CHANNEL channel ,
23269  PORTS_BIT_POS bitPos ) ;
23270 // *****************************************************************************
23271 /* Function:
23272  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
23273  PORTS_CHANNEL channel,
23274  PORTS_BIT_POS bitPos )
23275  Summary:
23276  Toggles the selected digital pin.
23277  <p><b>Implementation:</b> Dynamic</p>
23278  Description:
23279  This function toggles the selected digital pin.
23280  Preconditions:
23281  None.
23282  Parameters:
23283  index - Identifier for the device instance to be configured
23284  channel - Identifier for the PORT channel: A, B, C, etc.
23285  bitPos - Possible values of PORTS_BIT_POS
23286  Returns:
23287  None.
23288  Example:
23289  <code>
23290  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23291  // application developer.
23292  // MY_PINNUM - PORTS_PIN_10
23293  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23294  </code>
23295  Remarks:
23296  Not all features are available on all devices. Refer to the specific device
23297  data sheet for availability.
23298 */
23299 
23300 void
23302  PORTS_MODULE_ID index ,
23303  PORTS_CHANNEL channel ,
23304  PORTS_BIT_POS bitPos ) ;
23305 // *****************************************************************************
23306 /* Function:
23307  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
23308  PORTS_CHANNEL channel,
23309  PORTS_BIT_POS bitPos )
23310  Summary:
23311  Sets the selected digital pin/latch.
23312  <p><b>Implementation:</b> Dynamic</p>
23313  Description:
23314  This function sets the selected digital pin/latch.
23315  Preconditions:
23316  None.
23317  Parameters:
23318  index - Identifier for the device instance to be configured
23319  channel - Identifier for the PORT channel: A, B, C, etc.
23320  bitPos - Possible values of PORTS_BIT_POS
23321  Returns:
23322  None.
23323  Example:
23324  <code>
23325  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23326  // application developer.
23327  // MY_PINNUM - PORTS_PIN_10
23328  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23329  </code>
23330  Remarks:
23331  Not all features are available on all devices. Refer to the specific device
23332  data sheet for availability.
23333 */
23334 
23335 void
23337  PORTS_MODULE_ID index ,
23338  PORTS_CHANNEL channel ,
23339  PORTS_BIT_POS bitPos ) ;
23340 // *****************************************************************************
23341 /* Function:
23342  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
23343  PORTS_CHANNEL channel,
23344  PORTS_BIT_POS bitPos )
23345  Summary:
23346  Clears the selected digital pin.
23347  <p><b>Implementation:</b> Dynamic</p>
23348  Description:
23349  This function clears the selected digital pin.
23350  Preconditions:
23351  None.
23352  Parameters:
23353  index - Identifier for the device instance to be configured
23354  channel - Identifier for the PORT channel: A, B, C, etc.
23355  bitPos - Possible values of PORTS_BIT_POS
23356  Returns:
23357  None.
23358  Example:
23359  <code>
23360  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23361  // application developer.
23362  // MY_PINNUM - PORTS_IO_PIN_10
23363  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23364  </code>
23365  Remarks:
23366  Not all features are available on all devices. Refer to the specific device
23367  data sheet for availability.
23368 */
23369 
23370 void
23372  PORTS_MODULE_ID index ,
23373  PORTS_CHANNEL channel ,
23374  PORTS_BIT_POS bitPos ) ;
23375 // *****************************************************************************
23376 /* Function:
23377  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
23378  SYS_PORTS_PIN_DIRECTION pinDir,
23379  PORTS_CHANNEL channel,
23380  PORTS_BIT_POS bitPos )
23381  Summary:
23382  Enables the direction for the selected pin.
23383  <p><b>Implementation:</b> Dynamic</p>
23384  Description:
23385  This function enables the direction for the selected pin.
23386  Preconditions:
23387  None.
23388  Parameters:
23389  index - Identifier for the device instance to be configured
23390  pinDir - Pin direction
23391  channel - Identifier for the PORT channel: A, B, C, etc.
23392  bitPos - Possible values of PORTS_BIT_POS
23393  Returns:
23394  None.
23395  Example:
23396  <code>
23397  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23398  // application developer.
23399  // MY_PINNUM - PORTS_PIN_10
23400  SYS_PORTS_PIN_DIRECTION pinDir;
23401  pinDir = SYS_PORTS_DIRECTION_INPUT;
23402  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
23403  </code>
23404  Remarks:
23405  Not all features are available on all devices. Refer to the specific device
23406  data sheet for availability.
23407 */
23408 
23409 void
23411  PORTS_MODULE_ID index ,
23412  SYS_PORTS_PIN_DIRECTION pinDir ,
23413  PORTS_CHANNEL channel ,
23414  PORTS_BIT_POS bitPos ) ;
23415 // *****************************************************************************
23416 /* Function:
23417  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
23418  PORTS_CHANNEL channel,
23419  PORTS_BIT_POS bitPos )
23420  Summary:
23421  Enables the open-drain functionality for the selected pin.
23422  <p><b>Implementation:</b> Dynamic</p>
23423  Description:
23424  This function enables the open-drain functionality for the selected pin.
23425  Preconditions:
23426  None.
23427  Parameters:
23428  index - Identifier for the device instance to be configured
23429  channel - Identifier for the PORT channel: A, B, C, etc.
23430  bitPos - Possible values of PORTS_BIT_POS
23431  Returns:
23432  None.
23433  Example:
23434  <code>
23435  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23436  // application developer.
23437  // MY_PINNUM - PORTS_PIN_10
23438  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23439  </code>
23440  Remarks:
23441  Not all features are available on all devices. Refer to the specific device
23442  data sheet for availability.
23443 */
23444 
23445 void
23447  PORTS_MODULE_ID index ,
23448  PORTS_CHANNEL channel ,
23449  PORTS_BIT_POS bitPos ) ;
23450 // *****************************************************************************
23451 /* Function:
23452  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
23453  PORTS_CHANNEL channel,
23454  PORTS_BIT_POS bitPos )
23455  Summary:
23456  Disables the open-drain functionality for the selected pin.
23457  <p><b>Implementation:</b> Dynamic</p>
23458  Description:
23459  This function disables the open-drain functionality for the selected pin.
23460  Preconditions:
23461  None.
23462  Parameters:
23463  index - Identifier for the device instance to be configured
23464  channel - Identifier for the PORT channel: A, B, C, etc.
23465  bitPos - Possible values of PORTS_BIT_POS
23466  Returns:
23467  None.
23468  Example:
23469  <code>
23470  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23471  // application developer.
23472  // MY_PINNUM - PORTS_PIN_10
23473  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23474  </code>
23475  Remarks:
23476  Not all features are available on all devices. Refer to the specific device
23477  data sheet for availability.
23478 */
23479 
23480 void
23482  PORTS_MODULE_ID index ,
23483  PORTS_CHANNEL channel ,
23484  PORTS_BIT_POS bitPos ) ;
23485 // *****************************************************************************
23486 /* Function:
23487  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
23488  PORTS_CHANNEL channel,
23489  PORTS_BIT_POS bitPos )
23490  Summary:
23491  Enables the pull-up functionality for the selected pin.
23492  <p><b>Implementation:</b> Dynamic</p>
23493  Description:
23494  This function enables the pull-up functionality for the selected pin.
23495  Preconditions:
23496  None.
23497  Parameters:
23498  index - Identifier for the device instance to be configured
23499  channel - Identifier for the PORT channel: A, B, C, etc.
23500  bitPos - Possible values of PORTS_BIT_POS
23501  Returns:
23502  None.
23503  Example:
23504  <code>
23505  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23506  // application developer.
23507  // MY_PINNUM - PORTS_PIN_10
23508  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23509  </code>
23510  Remarks:
23511  Not all features are available on all devices. Refer to the specific device
23512  data sheet for availability.
23513 */
23514 
23515 void
23517  PORTS_MODULE_ID index ,
23518  PORTS_CHANNEL channel ,
23519  PORTS_BIT_POS bitPos ) ;
23520 // *****************************************************************************
23521 /* Function:
23522  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
23523  PORTS_CHANNEL channel,
23524  PORTS_BIT_POS bitPos )
23525  Summary:
23526  Disables the pull-up functionality for the selected pin.
23527  <p><b>Implementation:</b> Dynamic</p>
23528  Description:
23529  This function disables the pull-up functionality for the selected pin.
23530  Preconditions:
23531  None.
23532  Parameters:
23533  index - Identifier for the device instance to be configured
23534  channel - Identifier for the PORT channel: A, B, C, etc.
23535  bitPos - Possible values of PORTS_BIT_POS
23536  Returns:
23537  None.
23538  Example:
23539  <code>
23540  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23541  // application developer.
23542  // MY_PINNUM - PORTS_PIN_10
23543  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23544  </code>
23545  Remarks:
23546  Not all features are available on all devices. Refer to the specific device
23547  data sheet for availability.
23548 */
23549 
23550 void
23552  PORTS_MODULE_ID index ,
23553  PORTS_CHANNEL channel ,
23554  PORTS_BIT_POS bitPos ) ;
23555 // *****************************************************************************
23556 /* Function:
23557  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23558  PORTS_CHANNEL channel,
23559  PORTS_BIT_POS bitPos )
23560  Summary:
23561  Enables the pull-down functionality for the selected pin.
23562  <p><b>Implementation:</b> Dynamic</p>
23563  Description:
23564  This function enables the pull-down functionality for the selected pin.
23565  Preconditions:
23566  None.
23567  Parameters:
23568  index - Identifier for the device instance to be configured
23569  channel - Identifier for the PORT channel: A, B, C, etc.
23570  bitPos - Possible values of PORTS_BIT_POS
23571  Returns:
23572  None.
23573  Example:
23574  <code>
23575  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23576  // application developer.
23577  // MY_PINNUM - PORTS_PIN_10
23578  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23579  </code>
23580  Remarks:
23581  Not all features are available on all devices. Refer to the specific device
23582  data sheet for availability.
23583 */
23584 
23585 void
23587  PORTS_MODULE_ID index ,
23588  PORTS_CHANNEL channel ,
23589  PORTS_BIT_POS bitPos ) ;
23590 // *****************************************************************************
23591 /* Function:
23592  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23593  PORTS_CHANNEL channel,
23594  PORTS_BIT_POS bitPos )
23595  Summary:
23596  Disables the pull-down functionality for the selected pin.
23597  <p><b>Implementation:</b> Dynamic</p>
23598  Description:
23599  This function disables the pull-down functionality for the selected pin.
23600  Preconditions:
23601  None.
23602  Parameters:
23603  index - Identifier for the device instance to be configured
23604  channel - Identifier for the PORT channel: A, B, C, etc.
23605  bitPos - Possible values of PORTS_BIT_POS
23606  Returns:
23607  None.
23608  Example:
23609  <code>
23610  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23611  // application developer.
23612  // MY_PINNUM - PORTS_PIN_10
23613  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23614  </code>
23615  Remarks:
23616  Not all features are available on all devices. Refer to the specific device
23617  data sheet for availability.
23618 */
23619 
23620 void
23622  PORTS_MODULE_ID index ,
23623  PORTS_CHANNEL channel ,
23624  PORTS_BIT_POS bitPos ) ;
23625 //******************************************************************************
23626 /* Function:
23627  void SYS_PORTS_InterruptEnable
23628  (
23629  PORTS_MODULE_ID index,
23630  PORTS_CHANNEL channel,
23631  PORTS_BIT_POS bitPos,
23632  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23633  )
23634  Summary:
23635  Enables the selected interrupt for the selected port pin.
23636  Description:
23637  This function enables the selected interrupt for the selected port pin.
23638  Preconditions:
23639  Select the pull-up or pull-down as required.
23640  Parameters:
23641  index - Identifier for the device instance to be configured
23642  channel - Identifier for the PORT channel: A, B, C, etc.
23643  bitPos - Possible values of PORTS_BIT_POS
23644  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23645  Returns:
23646  None.
23647  Example:
23648  <code>
23649  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23650  </code>
23651  Remarks:
23652  None.
23653 */
23654 
23655 void
23657  PORTS_MODULE_ID index ,
23658  PORTS_CHANNEL channel ,
23659  PORTS_BIT_POS bitPos ,
23660  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23661 //DOM-IGNORE-BEGIN
23662 //DOM-IGNORE-END
23663  //SYS_PORTS_H
23664 /*******************************************************************************
23665  End of File
23666 */
23667 
23668 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23669 /* CLOSE_FILE Include File */
23670 
23671 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23672 /*******************************************************************************
23673  SPI Driver Interface
23674  Company:
23675  Microchip Technology Inc.
23676  File Name:
23677  drv_spi.h
23678  Summary:
23679  SPI device driver interface file.
23680  Description:
23681  The SPI driver provides a simple interface to manage the SPI module.
23682  This file defines the interface definitions and prototypes for the SPI driver.
23683 *******************************************************************************/
23684 //DOM-IGNORE-BEGIN
23685 /*******************************************************************************
23686 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23687 Microchip licenses to you the right to use, modify, copy and distribute
23688 Software only when embedded on a Microchip microcontroller or digital signal
23689 controller that is integrated into your product or third party product
23690 (pursuant to the sublicense terms in the accompanying license agreement).
23691 You should refer to the license agreement accompanying this Software for
23692 additional information regarding your rights and obligations.
23693 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23694 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23695 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23696 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23697 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23698 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23699 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23700 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23701 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23702 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23703 *******************************************************************************/
23704 //DOM-IGNORE-END
23705 #ifndef _DRV_SPI_H
23706 #define _DRV_SPI_H
23707 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23708 /*******************************************************************************
23709  SPI Driver Interface
23710  Company:
23711  Microchip Technology Inc.
23712  File Name:
23713  drv_spi_definitions.h
23714  Summary:
23715  SPI device driver interface file.
23716  Description:
23717  The SPI driver provides a simple interface to manage the SPI module.
23718  This file defines the interface definitions and prototypes for the SPI
23719  driver.
23720 *******************************************************************************/
23721 //DOM-IGNORE-BEGIN
23722 /*******************************************************************************
23723 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23724 Microchip licenses to you the right to use, modify, copy and distribute
23725 Software only when embedded on a Microchip microcontroller or digital signal
23726 controller that is integrated into your product or third party product
23727 (pursuant to the sublicense terms in the accompanying license agreement).
23728 You should refer to the license agreement accompanying this Software for
23729 additional information regarding your rights and obligations.
23730 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23731 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23732 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23733 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23734 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23735 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23736 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23737 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23738 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23739 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23740 *******************************************************************************/
23741 //DOM-IGNORE-END
23742 #ifndef _DRV_SPI_DEFINITIONS_H
23743 #define _DRV_SPI_DEFINITIONS_H
23744 // *****************************************************************************
23745 // *****************************************************************************
23746 // Section: Data Types
23747 // *****************************************************************************
23748 // *****************************************************************************
23749 #include <stdint.h>
23750 #include <stdbool.h>
23751 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23752 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23753 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23754 /*******************************************************************************
23755  SPI Peripheral Library Interface Header
23756  Company:
23757  Microchip Technology Inc.
23758  File Name:
23759  plib_spi.h
23760  Summary:
23761  SPI Peripheral Library Interface Header for common definitions.
23762  Description:
23763  This header file contains the function prototypes and definitions of
23764  the data types and constants that make up the interface to the SPI
23765  PLIB.
23766  *******************************************************************************/
23767 // DOM-IGNORE-BEGIN
23768 /*******************************************************************************
23769 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23770 Microchip licenses to you the right to use, modify, copy and distribute
23771 Software only when embedded on a Microchip microcontroller or digital signal
23772 controller that is integrated into your product or third party product
23773 (pursuant to the sublicense terms in the accompanying license agreement).
23774 You should refer to the license agreement accompanying this Software for
23775 additional information regarding your rights and obligations.
23776 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23777 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23778 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23779 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23780 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23781 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23782 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23783 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23784 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23785 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23786  *******************************************************************************/
23787 // DOM-IGNORE-END
23788 #ifndef _PLIB_SPI_H
23789 #define _PLIB_SPI_H
23790 // DOM-IGNORE-BEGIN
23791 // DOM-IGNORE-END
23792 // *****************************************************************************
23793 // *****************************************************************************
23794 // Section: Included Files (continued at end of file)
23795 // *****************************************************************************
23796 // *****************************************************************************
23797 /* This section lists the other files that are included in this file. However,
23798  please see the end of the file for additional implementation header files
23799  that are also included.
23800  */
23801 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23802 //DOM-IGNORE-BEGIN
23803 /*******************************************************************************
23804 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23805 Microchip licenses to you the right to use, modify, copy and distribute
23806 Software only when embedded on a Microchip microcontroller or digital signal
23807 controller that is integrated into your product or third party product
23808 (pursuant to the sublicense terms in the accompanying license agreement).
23809 You should refer to the license agreement accompanying this Software for
23810 additional information regarding your rights and obligations.
23811 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23812 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23813 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23814 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23815 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23816 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23817 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23818 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23819 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23820 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23821  *******************************************************************************/
23822 //DOM-IGNORE-END
23823 #ifndef _PLIB_SPI_PROCESSOR_H
23824 #define _PLIB_SPI_PROCESSOR_H
23825 #error "Can't find header"
23826 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23827 /* CLOSE_FILE Include File */
23828 
23829 // *****************************************************************************
23830 // *****************************************************************************
23831 // Section: Constants & Data Types
23832 // *****************************************************************************
23833 // *****************************************************************************
23834 // *****************************************************************************
23835 // *****************************************************************************
23836 // Section: SPI Peripheral Library Interface Routines
23837 // *****************************************************************************
23838 // *****************************************************************************
23839 //******************************************************************************
23840 /* Function:
23841  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23842  Summary:
23843  Enables the SPI module.
23844  Description:
23845  This function enables the SPI module.
23846  This operation is atomic.
23847  Precondition:
23848  None.
23849  Parameters:
23850  index - Identifier for the device instance to be configured
23851  Returns:
23852  None.
23853  Example:
23854  <code>
23855  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23856  // application developer.
23857  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23858  </code>
23859  Remarks:
23860  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23861  before use.
23862  This function implements an operation of the enable control feature. This
23863  feature may not be available on all devices. Please refer to the specific
23864  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23865  in your application to automatically determine whether this feature is available.
23866  */
23867 
23868 void
23869  PLIB_SPI_Enable (
23870  SPI_MODULE_ID index ) ;
23871 //******************************************************************************
23872 /* Function:
23873  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23874  Summary:
23875  Disables the SPI module.
23876  Description:
23877  This function disables the SPI module.
23878  This operation is atomic.
23879  Precondition:
23880  None.
23881  Parameters:
23882  index - Identifier for the device instance to be configured
23883  Returns:
23884  None.
23885  Example:
23886  <code>
23887  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23888  // application developer.
23889  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23890  </code>
23891  Remarks:
23892  This function implements an operation of the enable control feature. This
23893  feature may not be available on all devices. Please refer to the specific
23894  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23895  in your application to automatically determine whether this feature is available.
23896  */
23897 
23898 void
23900  SPI_MODULE_ID index ) ;
23901 //******************************************************************************
23902 /* Function:
23903  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23904  Summary:
23905  Discontinues module operation when the device enters Idle mode.
23906  Description:
23907  This function sets up the SPI module such that module operation is disabled
23908  when the device enters Idle mode.
23909  This operation is atomic.
23910  Precondition:
23911  None.
23912  Parameters:
23913  index - Identifier for the device instance to be configured
23914  Returns:
23915  None.
23916  Example:
23917  <code>
23918  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23919  // application developer.
23920  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23921  </code>
23922  Remarks:
23923  This function implements an operation of the stop in idle control feature.
23924  This feature may not be available on all devices. Please refer to the
23925  specific device data sheet to determine availability or use
23926  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23927  determine if this feature is available.
23928  */
23929 
23930 void
23932  SPI_MODULE_ID index ) ;
23933 //******************************************************************************
23934 /* Function:
23935  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23936  Summary:
23937  Continues module operation when the device enters Idle mode.
23938  Description:
23939  This function sets up the SPI module such that module operation is continued
23940  when the device enters Idle mode.
23941  This operation is atomic.
23942  Precondition:
23943  None.
23944  Parameters:
23945  index - Identifier for the device instance to be configured
23946  Returns:
23947  None.
23948  Example:
23949  <code>
23950  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23951  // application developer.
23952  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23953  </code>
23954  Remarks:
23955  This function implements an operation of the stop in idle control feature.
23956  This feature may not be available on all devices. Please refer to the
23957  specific device data sheet to determine availability or use
23958  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23959  this feature is available.
23960  */
23961 
23962 void
23964  SPI_MODULE_ID index ) ;
23965 //******************************************************************************
23966 /* Function:
23967  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23968  Summary:
23969  Returns the current status of the SPI receiver overflow.
23970  Description:
23971  This function returns the current status of the SPI receiver overflow.
23972  This operation is atomic.
23973  Precondition:
23974  None.
23975  Parameters:
23976  index - Identifier for the device instance to be configured
23977  Returns:
23978  SPI receiver overflow status:
23979  - true - A new byte/word is completely received and discarded.
23980  The user software has not read the previous data in
23981  the SPI buffer register.
23982  - false - No Overflow has occurred
23983  Example:
23984  <code>
23985  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23986  // application developer.
23987  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23988  </code>
23989  Remarks:
23990  This function implements an operation of the receiver overflow status feature.
23991  This feature may not be available on all devices. Please refer to the
23992  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23993  in your application to automatically determine whether this feature is available.
23994  */
23995 
23996 bool
23998  SPI_MODULE_ID index ) ;
23999 //******************************************************************************
24000 /* Function:
24001  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
24002  Summary:
24003  Clears the SPI receive overflow flag.
24004  Description:
24005  This function clears the SPI receive overflow flag.
24006  This operation is atomic.
24007  Precondition:
24008  None.
24009  Parameters:
24010  index - Identifier for the device instance to be configured
24011  Returns:
24012  None.
24013  Example:
24014  <code>
24015  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24016  // application developer.
24017  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
24018  </code>
24019  Remarks:
24020  This function implements an operation of the receiver overflow status feature.
24021  This feature may not be available on all devices. Please refer to the
24022  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
24023  in your application to automatically determine whether this feature is available.
24024  */
24025 
24026 void
24028  SPI_MODULE_ID index ) ;
24029 //******************************************************************************
24030 /* Function:
24031  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
24032  Summary:
24033  Returns the current transmit buffer status of the SPI module.
24034  Description:
24035  This function returns the current transmit buffer status of the SPI module.
24036  This operation is atomic.
24037  Precondition:
24038  None.
24039  Parameters:
24040  index - Identifier for the device instance to be configured
24041  Returns:
24042  - true - Transmit not yet started, transmit buffer is full
24043  - false - Transmit started, transmit buffer is empty/not full
24044  Example:
24045  <code>
24046  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24047  // application developer.
24048  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
24049  </code>
24050  Remarks:
24051  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
24052  occur, loading the transmit buffer. Automatically cleared in hardware when
24053  the SPI module transfers data from the transmit buffer to the shift register.
24054  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
24055  occur, loading the last available buffer. Automatically cleared in hardware
24056  when the buffer is available for writing.
24057  This function implements an operation of the transmit buffer status feature.
24058  This feature may not be available on all devices. Please refer to the
24059  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
24060  in your application to automatically determine whether this feature is available.
24061  */
24062 
24063 bool
24065  SPI_MODULE_ID index ) ;
24066 //******************************************************************************
24067 /* Function:
24068  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
24069  Summary:
24070  Returns the current status of the SPI receive buffer.
24071  Description:
24072  This function returns the current status of the SPI receive buffer.
24073  This operation is atomic.
24074  Precondition:
24075  None.
24076  Parameters:
24077  index - Identifier for the device instance to be configured
24078  Returns:
24079  Receiver Buffer Full Status:
24080  - true - Receive complete, receive buffer is full
24081  - false - Receive is not complete, receive buffer is empty
24082  Example:
24083  <code>
24084  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24085  // application developer.
24086  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
24087  </code>
24088  Remarks:
24089  In Standard Buffer mode - automatically set in hardware when the SPI module
24090  transfers data from the shift register to the receive buffer. Automatically
24091  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
24092  In Enhanced Buffer mode - automatically set in hardware when the SPI module
24093  transfers data from the shift register to the receive buffer, filling the
24094  last unread buffer. Automatically cleared in hardware when a buffer is available
24095  for a transfer from the shift register.
24096  This function implements an operation of the receiver buffer status feature.
24097  This feature may not be available on all devices. Please refer to the
24098  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
24099  in your application to automatically determine whether this feature is available.
24100  */
24101 
24102 bool
24104  SPI_MODULE_ID index ) ;
24105 //******************************************************************************
24106 /* Function:
24107  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
24108  Summary:
24109  Enables the selected SPI pins.
24110  Description:
24111  This function enables the selected SPI pins.
24112  Precondition:
24113  None.
24114  Parameters:
24115  index - Identifier for the device instance to be configured
24116  pin - One of the SPI_PIN enumeration values as the SPI pin
24117  Returns:
24118  None.
24119  Example:
24120  <code>
24121  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24122  // application developer.
24123  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
24124  </code>
24125  Remarks:
24126  This function implements an operation of the pin control feature.
24127  This feature may not be available on all devices. Please refer to the
24128  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
24129  in your application to automatically determine whether this feature is available.
24130  */
24131 
24132 void
24134  SPI_MODULE_ID index ,
24135  SPI_PIN pin ) ;
24136 //******************************************************************************
24137 /* Function:
24138  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
24139  Summary:
24140  Enables the selected SPI pins.
24141  Description:
24142  This function enables the selected SPI pins.
24143  Precondition:
24144  None.
24145  Parameters:
24146  index - Identifier for the device instance to be configured
24147  pin - One of the SPI_PIN enumeration values as the SPI pin
24148  Returns:
24149  None.
24150  Example:
24151  <code>
24152  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24153  // application developer.
24154  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
24155  </code>
24156  Remarks:
24157  This function implements an operation of the pin control feature.
24158  This feature may not be available on all devices. Please refer to the
24159  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
24160  in your application to automatically determine whether this feature is available.
24161  */
24162 
24163 void
24165  SPI_MODULE_ID index ,
24166  SPI_PIN pin ) ;
24167 //******************************************************************************
24168 /* Function:
24169  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
24170  SPI_COMMUNICATION_WIDTH width )
24171  Summary:
24172  Selects the data width for the SPI communication.
24173  Description:
24174  This function selects the data width for the SPI communication.
24175  This operation is atomic.
24176  Precondition:
24177  None.
24178  Parameters:
24179  index - Identifier for the device instance to be configured
24180  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
24181  SPI buffer width
24182  Returns:
24183  None.
24184  Example:
24185  <code>
24186  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24187  // application developer.
24188  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
24189  </code>
24190  Remarks:
24191  This function implements an operation of the communication width feature.
24192  This feature may not be available on all devices. Please refer to the
24193  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
24194  in your application to automatically determine whether this feature is available.
24195  */
24196 
24197 void
24199  SPI_MODULE_ID index ,
24200  SPI_COMMUNICATION_WIDTH width ) ;
24201 //******************************************************************************
24202 /* Function:
24203  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
24204  SPI_AUDIO_COMMUNICATION_WIDTH width )
24205  Summary:
24206  Selects the data width for the SPI audio communication.
24207  Description:
24208  This function selects the data width for the SPI audio communication.
24209  This operation is atomic.
24210  Precondition:
24211  None.
24212  Parameters:
24213  index - Identifier for the device instance to be configured
24214  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
24215  SPI buffer width
24216  Returns:
24217  None.
24218  Example:
24219  <code>
24220  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24221  // application developer.
24222  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
24223  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
24224  </code>
24225  Remarks:
24226  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
24227  This function implements an operation of the audio communication width feature.
24228  This feature may not be available on all devices. Please refer to the
24229  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
24230  in your application to automatically determine whether this feature is available.
24231  */
24232 
24233 void
24235  SPI_MODULE_ID index ,
24236  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
24237 //******************************************************************************
24238 /* Function:
24239  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
24240  SPI_INPUT_SAMPLING_PHASE phase)
24241  Summary:
24242  Selects the SPI data input sample phase.
24243  Description:
24244  This function selects the input sampling phase in Master mode.
24245  Precondition:
24246  None.
24247  Parameters:
24248  index - Identifier for the device instance to be configured
24249  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
24250  sampling phase
24251  Returns:
24252  None.
24253  Example:
24254  <code>
24255  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24256  // application developer.
24257  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
24258  </code>
24259  Remarks:
24260  This function implements an operation of the input sample phase feature.
24261  This feature may not be available on all devices. Please refer to the
24262  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
24263  in your application to automatically determine whether this feature is available.
24264  */
24265 
24266 void
24268  SPI_MODULE_ID index ,
24269  SPI_INPUT_SAMPLING_PHASE phase ) ;
24270 //******************************************************************************
24271 /* Function:
24272  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
24273  SPI_OUTPUT_DATA_PHASE data)
24274  Summary:
24275  Selects serial output data change.
24276  Description:
24277  This function selects serial output data change.
24278  Precondition:
24279  None.
24280  Parameters:
24281  index - Identifier for the device instance to be configured
24282  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
24283  SPI serial output data change
24284  Returns:
24285  None.
24286  Example:
24287  <code>
24288  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24289  // application developer.
24290  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
24291  </code>
24292  Remarks:
24293  This function implements an operation of the output data phase feature.
24294  This feature may not be available on all devices. Please refer to the
24295  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
24296  in your application to automatically determine whether this feature is available.
24297  */
24298 
24299 void
24301  SPI_MODULE_ID index ,
24302  SPI_OUTPUT_DATA_PHASE phase ) ;
24303 //******************************************************************************
24304 /* Function:
24305  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
24306  SPI_CLOCK_POLARITY polarity)
24307  Summary:
24308  Enables clock polarity.
24309  Description:
24310  This function enables clock polarity.
24311  Precondition:
24312  None.
24313  Parameters:
24314  index - Identifier for the device instance to be configured
24315  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
24316  Returns:
24317  None.
24318  Example:
24319  <code>
24320  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24321  // application developer.
24322  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
24323  </code>
24324  Remarks:
24325  This function implements an operation of the clock polarity feature.
24326  This feature may not be available on all devices. Please refer to the
24327  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
24328  in your application to automatically determine whether this feature is available.
24329  */
24330 
24331 void
24333  SPI_MODULE_ID index ,
24334  SPI_CLOCK_POLARITY polarity ) ;
24335 //******************************************************************************
24336 /* Function:
24337  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
24338  Summary:
24339  Enables the SPI in Master mode.
24340  Description:
24341  This function enables the SPI in Master mode.
24342  This operation is atomic.
24343  Precondition:
24344  None.
24345  Parameters:
24346  index - Identifier for the device instance to be configured
24347  Returns:
24348  None.
24349  Example:
24350  <code>
24351  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24352  // application developer.
24353  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
24354  </code>
24355  Remarks:
24356  This function implements an operation of the master enable control feature.
24357  This feature may not be available on all devices. Please refer to the
24358  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24359  in your application to automatically determine whether this feature is available.
24360  */
24361 
24362 void
24364  SPI_MODULE_ID index ) ;
24365 //******************************************************************************
24366 /* Function:
24367  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
24368  Summary:
24369  Enables the SPI in Slave mode.
24370  Description:
24371  This function enables the SPI in Slave mode.
24372  This operation is atomic.
24373  Precondition:
24374  None.
24375  Parameters:
24376  index - Identifier for the device instance to be configured
24377  Returns:
24378  None.
24379  Example:
24380  <code>
24381  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24382  // application developer.
24383  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
24384  </code>
24385  Remarks:
24386  This function implements an operation of the master enable control feature.
24387  This feature may not be available on all devices. Please refer to the
24388  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24389  in your application to automatically determine whether this feature is available.
24390  */
24391 
24392 void
24394  SPI_MODULE_ID index ) ;
24395 //******************************************************************************
24396 /* Function:
24397  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
24398  uint32_t baudRate )
24399  Summary:
24400  Sets the baud rate to the desired value.
24401  Description:
24402  This function sets the baud rate to the desired value.
24403  Precondition:
24404  None.
24405  Parameters:
24406  index - Identifier for the device instance to be configured
24407  clockFrequency - Clock frequency
24408  baudrate - Baud rate value
24409  Returns:
24410  None.
24411  Example:
24412  <code>
24413  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24414  // application developer.
24415  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
24416  </code>
24417  Remarks:
24418  Setting a new baud rate value causes the baud rate timer to reset.
24419  This ensures that the baud rate timer does not have to overflow before
24420  outputting the new baud rate.
24421  If the system clock is changed during an active receive operation, a
24422  receive error or data loss may result. To avoid this issue, verify that
24423  no receptions are in progress before changing the system clock.
24424  This function implements an operation of the baud rate set feature.
24425  This feature may not be available on all devices. Please refer to the
24426  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
24427  in your application to automatically determine whether this feature is available.
24428  */
24429 
24430 void
24432  SPI_MODULE_ID index ,
24433  uint32_t clockFrequency ,
24434  uint32_t baudRate ) ;
24435 //******************************************************************************
24436 /* Function:
24437  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
24438  Summary:
24439  Returns the current SPI module activity status.
24440  Description:
24441  This function returns the current SPI module activity status.
24442  This operation is atomic.
24443  Precondition:
24444  None.
24445  Parameters:
24446  index - Identifier for the device instance to be configured
24447  Returns:
24448  - true - SPI module is currently busy with some transactions
24449  - false - SPI module is currently idle
24450  Example:
24451  <code>
24452  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24453  // application developer.
24454  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
24455  </code>
24456  Remarks:
24457  This function implements an operation of the bus status feature.
24458  This feature may not be available on all devices. Please refer to the
24459  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
24460  in your application to automatically determine whether this feature is available.
24461  */
24462 
24463 bool
24464  PLIB_SPI_IsBusy (
24465  SPI_MODULE_ID index ) ;
24466 //******************************************************************************
24467 /* Function:
24468  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
24469  Summary:
24470  Returns the current status of the receive (RX) FIFO sign-extended data.
24471  Description:
24472  This function returns the current status of the receive (RX) FIFO
24473  sign-extended data.
24474  This operation is atomic.
24475  Precondition:
24476  None.
24477  Parameters:
24478  index - Identifier for the device instance to be configured
24479  Returns:
24480  - true - Data from RX FIFO is sign-extended
24481  - false - Data from RX FIFO is not sign-extended
24482  Example:
24483  <code>
24484  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24485  // application developer.
24486  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
24487  </code>
24488  Remarks:
24489  This function implements an operation of the data sign feature.
24490  This feature may not be available on all devices. Please refer to the
24491  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
24492  in your application to automatically determine whether this feature is available.
24493  */
24494 
24495 bool
24497  SPI_MODULE_ID index ) ;
24498 //******************************************************************************
24499 /* Function:
24500  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
24501  Summary:
24502  Enables Master mode slave select.
24503  Description:
24504  This function enables Master mode slave select.
24505  This operation is atomic.
24506  Precondition:
24507  None.
24508  Parameters:
24509  index - Identifier for the device instance to be configured
24510  Returns:
24511  None.
24512  Example:
24513  <code>
24514  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24515  // application developer.
24516  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
24517  </code>
24518  Remarks:
24519  This feature does not support Framed SPI mode.
24520  This function implements an operation of the Master mode slave select feature.
24521  This feature may not be available on all devices. Please refer to the
24522  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24523  in your application to automatically determine whether this feature is available.
24524 
24525  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
24526  */
24527 
24528 void
24530  SPI_MODULE_ID index ) ;
24531 //******************************************************************************
24532 /* Function:
24533  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
24534  Summary:
24535  Disables Master mode slave select.
24536  Description:
24537  This function disables Master mode slave select.
24538  This operation is atomic.
24539  Precondition:
24540  None.
24541  Parameters:
24542  index - Identifier for the device instance to be configured
24543  Returns:
24544  None.
24545  Example:
24546  <code>
24547  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24548  // application developer.
24549  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24550  </code>
24551  Remarks:
24552  This feature does not support Framed SPI mode.
24553  This function implements an operation of the slave select feature.
24554  This feature may not be available on all devices. Please refer to the
24555  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24556  in your application to automatically determine whether this feature is available.
24557 
24558  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24559  */
24560 
24561 void
24563  SPI_MODULE_ID index ) ;
24564 //******************************************************************************
24565 /* Function:
24566  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24567  Summary:
24568  Returns the current status of the transmit underrun.
24569  Description:
24570  This function returns the current status of the transmit underrun.
24571  This operation is atomic.
24572  Precondition:
24573  None.
24574  Parameters:
24575  index - Identifier for the device instance to be configured
24576  Returns:
24577  - true - Transmit buffer has encountered an underrun condition
24578  - false - Transmit buffer run has not encountered an underrun condition
24579  Example:
24580  <code>
24581  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24582  // application developer.
24583  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24584  </code>
24585  Remarks:
24586  Valid in Framed Sync mode.
24587  This function implements an operation of the transmit underrun status feature.
24588  This feature may not be available on all devices. Please refer to the
24589  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24590  in your application to automatically determine whether this feature is available.
24591  */
24592 
24593 bool
24595  SPI_MODULE_ID index ) ;
24596 //******************************************************************************
24597 /* Function:
24598  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24599  Summary:
24600  Clears the SPI transmit underrun flag.
24601  Description:
24602  This function clears the SPI transmit underrun flag.
24603  This operation is atomic.
24604  Precondition:
24605  None.
24606  Parameters:
24607  index - Identifier for the device instance to be configured
24608  Returns:
24609  None.
24610  Example:
24611  <code>
24612  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24613  // application developer.
24614  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24615  </code>
24616  Remarks:
24617  This function implements an operation of the transmit underrun status feature.
24618  This feature may not be available on all devices. Please refer to the
24619  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24620  in your application to automatically determine whether this feature is available.
24621  */
24622 
24623 void
24625  SPI_MODULE_ID index ) ;
24626 //******************************************************************************
24627 /* Function:
24628  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24629  Summary:
24630  Returns the current status of the transmit buffer.
24631  Description:
24632  This function returns the current status of the transmit buffer.
24633  This operation is atomic.
24634  Precondition:
24635  None.
24636  Parameters:
24637  index - Identifier for the device instance to be configured
24638  Returns:
24639  - true - Transmit buffer is empty
24640  - false - Transmit buffer is not empty
24641  Example:
24642  <code>
24643  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24644  // application developer.
24645  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24646  </code>
24647  Remarks:
24648  This function implements an operation of the transmit buffer empty status feature.
24649  This feature may not be available on all devices. Please refer to the
24650  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24651  in your application to automatically determine whether this feature is available.
24652  */
24653 
24654 bool
24656  SPI_MODULE_ID index ) ;
24657 //******************************************************************************
24658 /* Function:
24659  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24660  Summary:
24661  Enables the SPI enhanced buffer.
24662  Description:
24663  This function enables the SPI enhanced buffer.
24664  This operation is atomic.
24665  Precondition:
24666  None.
24667  Parameters:
24668  index - Identifier for the device instance to be configured
24669  Returns:
24670  None.
24671  Example:
24672  <code>
24673  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24674  // application developer.
24675  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24676  </code>
24677  Remarks:
24678  This enables the enhanced buffer mode.
24679  This function implements an operation of the FIFO control feature.
24680  This feature may not be available on all devices. Please refer to the
24681  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24682  in your application to automatically determine whether this feature is available.
24683  */
24684 
24685 void
24687  SPI_MODULE_ID index ) ;
24688 //******************************************************************************
24689 /* Function:
24690  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24691  Summary:
24692  Disables the SPI enhanced buffer.
24693  Description:
24694  This function disables the SPI enhanced buffer.
24695  This operation is atomic.
24696  Precondition:
24697  None.
24698  Parameters:
24699  index - Identifier for the device instance to be configured
24700  Returns:
24701  None.
24702  Example:
24703  <code>
24704  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24705  // application developer.
24706  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24707  </code>
24708  Remarks:
24709  Enables the legacy standard single buffer mode.
24710  This function implements an operation of the FIFO control feature.
24711  This feature may not be available on all devices. Please refer to the
24712  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24713  in your application to automatically determine whether this feature is available.
24714  */
24715 
24716 void
24718  SPI_MODULE_ID index ) ;
24719 //******************************************************************************
24720 /* Function:
24721  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24722  Summary:
24723  Reads the SPI Buffer Element Count bits for either receive or transmit.
24724  Description:
24725  This function reads the number of SPI transfers pending for Master mode
24726  and the number of unread SPI transfers for Slave mode.
24727  Precondition:
24728  None.
24729  Parameters:
24730  index - Identifier for the device instance to be configured
24731  type - One of the SPI_FIFO_TYPE enumeration values
24732  Returns:
24733  CountValue - Buffer element count bits
24734  Example:
24735  <code>
24736  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24737  // application developer.
24738  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24739  </code>
24740  Remarks:
24741  Valid in Enhanced Buffer mode.
24742  This function implements an operation of the FIFO control feature.
24743  This feature may not be available on all devices. Please refer to the
24744  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24745  in your application to automatically determine whether this feature is available.
24746  */
24747 
24748 uint8_t
24750  SPI_MODULE_ID index ,
24751  SPI_FIFO_TYPE type ) ;
24752 //******************************************************************************
24753 /* Function:
24754  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24755  Summary:
24756  Returns the current status of the SPI shift register.
24757  Description:
24758  This function returns the current status of the SPI shift register.
24759  This operation is atomic.
24760  Precondition:
24761  None.
24762  Parameters:
24763  index - Identifier for the device instance to be configured
24764  Returns:
24765  - true - SPI shift register is empty and ready to send or receive
24766  - false - SPI shift register is not empty
24767  Example:
24768  <code>
24769  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24770  // application developer.
24771  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24772  </code>
24773  Remarks:
24774  Valid in Enhanced Buffer mode.
24775  This function implements an operation of the FIFO status feature.
24776  This feature may not be available on all devices. Please refer to the
24777  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24778  in your application to automatically determine whether this feature is available.
24779  */
24780 
24781 bool
24783  SPI_MODULE_ID index ) ;
24784 //******************************************************************************
24785 /* Function:
24786  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24787  Summary:
24788  Returns the current status of the SPI receive FIFO.
24789  Description:
24790  This function returns the current status of the SPI receive FIFO.
24791  This operation is atomic.
24792  Precondition:
24793  None.
24794  Parameters:
24795  index - Identifier for the device instance to be configured
24796  Returns:
24797  - true - Receive FIFO is empty
24798  - false - Receive FIFO is not empty
24799  Example:
24800  <code>
24801  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24802  // application developer.
24803  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24804  </code>
24805  Remarks:
24806  Valid in Enhanced Buffer mode.
24807  This function implements an operation of the FIFO status feature.
24808  This feature may not be available on all devices. Please refer to the
24809  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24810  in your application to automatically determine whether this feature is available.
24811  */
24812 
24813 bool
24815  SPI_MODULE_ID index ) ;
24816 //******************************************************************************
24817 /* Function:
24818  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24819  SPI_FIFO_INTERRUPT mode)
24820  Summary:
24821  Selects the SPI buffer interrupt mode.
24822  Description:
24823  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24824  Precondition:
24825  None.
24826  Parameters:
24827  index - Identifier for the device instance to be configured
24828  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24829  interrupt mode
24830  Returns:
24831  None.
24832  Example:
24833  <code>
24834  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24835  // application developer.
24836  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24837  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24838  </code>
24839  Remarks:
24840  Valid in Enhanced Buffer mode.
24841  This function implements an operation of the FIFO interrupt feature.
24842  This feature may not be available on all devices. Please refer to the
24843  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24844  in your application to automatically determine whether this feature is available.
24845  */
24846 
24847 void
24849  SPI_MODULE_ID index ,
24850  SPI_FIFO_INTERRUPT mode ) ;
24851 //******************************************************************************
24852 /* Function:
24853  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24854  Summary:
24855  Enables framed SPI support.
24856  Description:
24857  This function enables framed SPI support.
24858  This operation is atomic.
24859  Precondition:
24860  None.
24861  Parameters:
24862  index - Identifier for the device instance to be configured
24863  Returns:
24864  None.
24865  Example:
24866  <code>
24867  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24868  // application developer.
24869  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24870  </code>
24871  Remarks:
24872  This function implements an operation of the framed communication feature.
24873  This feature may not be available on all devices. Please refer to the
24874  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24875  in your application to automatically determine whether this feature is available.
24876  */
24877 
24878 void
24880  SPI_MODULE_ID index ) ;
24881 //******************************************************************************
24882 /* Function:
24883  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24884  Summary:
24885  Disables framed SPI support.
24886  Description:
24887  This function disables framed SPI support.
24888  This operation is atomic.
24889  Precondition:
24890  None.
24891  Parameters:
24892  index - Identifier for the device instance to be configured
24893  Returns:
24894  None.
24895  Example:
24896  <code>
24897  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24898  // application developer.
24899  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24900  </code>
24901  Remarks:
24902  This function implements an operation of the framed communication feature.
24903  This feature may not be available on all devices. Please refer to the
24904  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24905  in your application to automatically determine whether this feature is available.
24906  */
24907 
24908 void
24910  SPI_MODULE_ID index ) ;
24911 //******************************************************************************
24912 /* Function:
24913  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24914  SPI_FRAME_PULSE_DIRECTION direction)
24915  Summary:
24916  Selects the frame sync pulse direction.
24917  Description:
24918  This function selects the frame sync pulse direction.
24919  Precondition:
24920  None.
24921  Parameters:
24922  index - Identifier for the device instance to be configured
24923  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24924  as the SPI frame sync pulse polarity
24925  Returns:
24926  None.
24927  Example:
24928  <code>
24929  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24930  // application developer.
24931  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24932  </code>
24933  Remarks:
24934  This function implements an operation of the framed communication feature.
24935  This feature may not be available on all devices. Please refer to the
24936  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24937  in your application to automatically determine whether this feature is available.
24938  */
24939 
24940 void
24942  SPI_MODULE_ID index ,
24943  SPI_FRAME_PULSE_DIRECTION direction ) ;
24944 //******************************************************************************
24945 /* Function:
24946  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24947  SPI_FRAME_PULSE_POLARITY polarity)
24948  Summary:
24949  Selects the frame sync pulse polarity.
24950  Description:
24951  This function selects the frame sync pulse polarity.
24952  Precondition:
24953  None.
24954  Parameters:
24955  index - Identifier for the device instance to be configured
24956  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24957  sync pulse polarity
24958  Returns:
24959  None.
24960  Example:
24961  <code>
24962  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24963  // application developer.
24964  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24965  </code>
24966  Remarks:
24967  Available only for Frame mode.
24968  This function implements an operation of the framed communication feature.
24969  This feature may not be available on all devices. Please refer to the
24970  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24971  in your application to automatically determine whether this feature is available.
24972  */
24973 
24974 void
24976  SPI_MODULE_ID index ,
24977  SPI_FRAME_PULSE_POLARITY polarity ) ;
24978 //******************************************************************************
24979 /* Function:
24980  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24981  SPI_FRAME_PULSE_EDGE edge)
24982  Summary:
24983  Selects the frame sync pulse edge.
24984  Description:
24985  This function selects the frame sync pulse edge.
24986  Precondition:
24987  None.
24988  Parameters:
24989  index - Identifier for the device instance to be configured
24990  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24991  SPI frame sync pulse edge
24992  Returns:
24993  None.
24994  Example:
24995  <code>
24996  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24997  // application developer.
24998  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24999  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
25000  </code>
25001  Remarks:
25002  This function implements an operation of the framed communication feature.
25003  This feature may not be available on all devices. Please refer to the
25004  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
25005  in your application to automatically determine whether this feature is available.
25006  */
25007 
25008 void
25010  SPI_MODULE_ID index ,
25011  SPI_FRAME_PULSE_EDGE edge ) ;
25012 //******************************************************************************
25013 /* Function:
25014  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
25015  SPI_FRAME_PULSE_WIDTH width)
25016  Summary:
25017  Sets the frame sync pulse width.
25018  Description:
25019  This function sets the frame sync pulse width.
25020  Precondition:
25021  None.
25022  Parameters:
25023  index - Identifier for the device instance to be configured
25024  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
25025  frame sync pulse width.
25026  Returns:
25027  None.
25028  Example:
25029  <code>
25030  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25031  // application developer.
25032  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
25033  </code>
25034  Remarks:
25035  Length of the word is dependent on the communication mode.
25036  This function implements an operation of the framed communication feature.
25037  This feature may not be available on all devices. Please refer to the
25038  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
25039  in your application to automatically determine whether this feature is available.
25040  */
25041 
25042 void
25044  SPI_MODULE_ID index ,
25045  SPI_FRAME_PULSE_WIDTH width ) ;
25046 //******************************************************************************
25047 /* Function:
25048  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
25049  SPI_FRAME_SYNC_PULSE pulse)
25050  Summary:
25051  Selects at which character the SPI frame sync pulse is generated.
25052  Description:
25053  This function selects at which character the SPI frame sync pulse is generated.
25054  Precondition:
25055  None.
25056  Parameters:
25057  index - Identifier for the device instance to be configured
25058  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
25059  frame sync pulse count
25060  Returns:
25061  None.
25062  Example:
25063  <code>
25064  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25065  // application developer.
25066  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
25067  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
25068  </code>
25069  Remarks:
25070  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
25071  This function implements an operation of the framed communication feature.
25072  This feature may not be available on all devices. Please refer to the
25073  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
25074  in your application to automatically determine whether this feature is available.
25075  */
25076 
25077 void
25079  SPI_MODULE_ID index ,
25080  SPI_FRAME_SYNC_PULSE pulse ) ;
25081 //******************************************************************************
25082 /* Function:
25083  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
25084  Summary:
25085  Returns the current status of the SPI frame error.
25086  Description:
25087  This function returns the current status of the SPI frame error.
25088  This operation is atomic.
25089  Precondition:
25090  None.
25091  Parameters:
25092  index - Identifier for the device instance to be configured
25093  Returns:
25094  - true - Frame error detected
25095  - false - No frame error detected
25096  Example:
25097  <code>
25098  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25099  // application developer.
25100  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
25101  </code>
25102  Remarks:
25103  Valid only if Frame mode is enabled.
25104  This function implements an operation of the framed communication feature.
25105  This feature may not be available on all devices. Please refer to the
25106  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
25107  in your application to automatically determine whether this feature is available.
25108  */
25109 
25110 bool
25112  SPI_MODULE_ID index ) ;
25113 //******************************************************************************
25114 /* Function:
25115  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
25116  Summary:
25117  Clears the SPI frame error flag.
25118  Description:
25119  This function clears the SPI frame error flag.
25120  This operation is atomic.
25121  Precondition:
25122  None.
25123  Parameters:
25124  index - Identifier for the device instance to be configured
25125  Returns:
25126  None.
25127  Example:
25128  <code>
25129  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25130  // application developer.
25131  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
25132  </code>
25133  Remarks:
25134  This function implements an operation of the frame error status feature.
25135  This feature may not be available on all devices. Please refer to the
25136  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
25137  in your application to automatically determine whether this feature is available.
25138  */
25139 
25140 void
25142  SPI_MODULE_ID index ) ;
25143 //******************************************************************************
25144 /* Function:
25145  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
25146  Summary:
25147  Clears the SPI receive buffer.
25148  Description:
25149  This function clears the SPI receive buffer.
25150  In Enhanced Buffer mode, this functions clears the full RX FIFO.
25151  This operation is atomic.
25152  Precondition:
25153  None.
25154  Parameters:
25155  index - Identifier for the device instance to be configured
25156  Returns:
25157  None.
25158  Example:
25159  <code>
25160  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25161  // application developer.
25162  //This call will flush the receive buffer.
25163  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
25164  </code>
25165  Remarks:
25166  This function implements an operation of the buffer control feature.
25167  This feature may not be available on all devices. Please refer to the
25168  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25169  in your application to automatically determine whether this feature is available.
25170  */
25171 
25172 void
25174  SPI_MODULE_ID index ) ;
25175 //******************************************************************************
25176 /* Function:
25177  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
25178  Summary:
25179  Returns the SPI buffer value.
25180  Description:
25181  This function returns the SPI buffer value.
25182  This operation is atomic.
25183  Precondition:
25184  None.
25185  Parameters:
25186  index - Identifier for the device instance to be configured
25187  Returns:
25188  Reads the SPI buffer.
25189  Example:
25190  <code>
25191  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25192  // application developer.
25193  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
25194  </code>
25195  Remarks:
25196  This function implements an operation of the buffer control feature.
25197  This feature may not be available on all devices. Please refer to the
25198  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25199  in your application to automatically determine whether this feature is available.
25200  */
25201 
25202 uint8_t
25204  SPI_MODULE_ID index ) ;
25205 //******************************************************************************
25206 /* Function:
25207  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
25208  Summary:
25209  Returns 16-bit SPI buffer value.
25210  Description:
25211  This function returns 16-bit SPI buffer value.
25212  This operation is atomic.
25213  Precondition:
25214  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25215  Parameters:
25216  index - Identifier for the device instance to be configured
25217  Returns:
25218  Returns the SPI 16-bit buffer value.
25219  Example:
25220  <code>
25221 #define MY_SPI_INSTANCE SPI_ID_1
25222 
25223  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
25224  </code>
25225  Remarks:
25226  This function implements an operation of the buffer control feature.
25227  This feature may not be available on all devices. Please refer to the
25228  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25229  in your application to automatically determine whether this feature is available.
25230  */
25231 
25232 uint16_t
25234  SPI_MODULE_ID index ) ;
25235 //******************************************************************************
25236 /* Function:
25237  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
25238  Summary:
25239  Returns 32-bit SPI buffer value.
25240  Description:
25241  This function returns 32-bit SPI buffer value.
25242  This operation is atomic.
25243  Precondition:
25244  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25245  Parameters:
25246  index - Identifier for the device instance to be configured
25247  Returns:
25248  Returns the SPI 32-bit buffer value.
25249  Example:
25250  <code>
25251 #define MY_SPI_INSTANCE SPI_ID_1
25252 
25253  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
25254  </code>
25255  Remarks:
25256  This function implements an operation of the buffer control feature.
25257  This feature may not be available on all devices. Please refer to the
25258  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25259  in your application to automatically determine whether this feature is available.
25260  */
25261 
25262 uint32_t
25264  SPI_MODULE_ID index ) ;
25265 //******************************************************************************
25266 /* Function:
25267  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
25268  Summary:
25269  Write the data to the SPI buffer.
25270  Description:
25271  This function writes data to the SPI buffer.
25272  This operation is atomic.
25273  Precondition:
25274  None.
25275  Parameters:
25276  index - Identifier for the device instance to be configured
25277  data - Data to written to the SPI buffer
25278  Returns:
25279  None.
25280  Example:
25281  <code>
25282  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25283  // application developer.
25284  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
25285  </code>
25286  Remarks:
25287  This function implements an operation of the buffer control feature.
25288  This feature may not be available on all devices. Please refer to the
25289  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25290  in your application to automatically determine whether this feature is available.
25291  */
25292 
25293 void
25295  SPI_MODULE_ID index ,
25296  uint8_t data ) ;
25297 //******************************************************************************
25298 /* Function:
25299  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
25300  Summary:
25301  Writes 16-bit data to the SPI buffer.
25302  Description:
25303  This function writes 16-bit data to the SPI buffer.
25304  This operation is atomic.
25305  Precondition:
25306  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25307  Parameters:
25308  index - Identifier for the device instance to be configured
25309  data - 16-bit data to be written to the SPI buffer
25310  Returns:
25311  None.
25312  Example:
25313  <code>
25314 #define MY_SPI_INSTANCE SPI_ID_1
25315 
25316  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
25317  </code>
25318  Remarks:
25319  This function implements an operation of the buffer control feature.
25320  This feature may not be available on all devices. Please refer to the
25321  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25322  in your application to automatically determine whether this feature is available.
25323  */
25324 
25325 void
25327  SPI_MODULE_ID index ,
25328  uint16_t data ) ;
25329 //******************************************************************************
25330 /* Function:
25331  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
25332  Summary:
25333  Write 32-bit data to the SPI buffer.
25334  Description:
25335  This function writes 32-bit data to the SPI buffer.
25336  This operation is atomic.
25337  Precondition:
25338  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25339  Parameters:
25340  index - Identifier for the device instance to be configured
25341  data - 32-bit data to be written to the SPI buffer
25342  Returns:
25343  None.
25344  Example:
25345  <code>
25346 #define MY_SPI_INSTANCE SPI_ID_1
25347 
25348  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
25349  </code>
25350  Remarks:
25351  This function implements an operation of the buffer control feature.
25352  This feature may not be available on all devices. Please refer to the
25353  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25354  in your application to automatically determine whether this feature is available.
25355  */
25356 
25357 void
25359  SPI_MODULE_ID index ,
25360  uint32_t data ) ;
25361 //******************************************************************************
25362 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
25363  Summary:
25364  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
25365  register.
25366  Description:
25367  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
25368  (SPIxRXB)) register.
25369  This operation is atomic.
25370  Preconditions:
25371  None.
25372  Parameters:
25373  index - Identifier for the device instance
25374  Returns:
25375  The address of the SPIxBUF register
25376  Remarks:
25377  None.
25378 */
25379 
25380 void *
25382  SPI_MODULE_ID index ) ;
25383 //******************************************************************************
25384 /* Function:
25385  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
25386  SPI_BAUD_RATE_CLOCK type)
25387  Summary:
25388  Selects the type of clock is used by the Baud Rate Generator.
25389  Description:
25390  This function selects the type of clock is used by the Baud Rate Generator.
25391  Precondition:
25392  None.
25393  Parameters:
25394  index - Identifier for the device instance to be configured
25395  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
25396  Returns:
25397  None.
25398  Example:
25399  <code>
25400  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25401  // application developer.
25402  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
25403  </code>
25404  Remarks:
25405  This function implements an operation of the baud rate clock control feature.
25406  This feature may not be available on all devices. Please refer to the
25407  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
25408  in your application to automatically determine whether this feature is available.
25409  */
25410 
25411 void
25413  SPI_MODULE_ID index ,
25414  SPI_BAUD_RATE_CLOCK type ) ;
25415 //******************************************************************************
25416 /* Function:
25417  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
25418  SPI_ERROR_INTERRUPT error)
25419  Summary:
25420  Enables SPI error interrupts
25421  Description:
25422  This function enables SPI error interrupts.
25423  Precondition:
25424  None.
25425  Parameters:
25426  index - Identifier for the device instance to be configured
25427  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
25428  SPI interrupt error
25429  Returns:
25430  None.
25431  Example:
25432  <code>
25433  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25434  // application developer.
25435  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25436  </code>
25437  Remarks:
25438  This function implements an operation of the error interrupt control feature.
25439  This feature may not be available on all devices. Please refer to the
25440  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25441  in your application to automatically determine whether this feature is available.
25442  */
25443 
25444 void
25446  SPI_MODULE_ID index ,
25447  SPI_ERROR_INTERRUPT error ) ;
25448 //******************************************************************************
25449 /* Function:
25450  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
25451  SPI_ERROR_INTERRUPT error)
25452  Summary:
25453  Enables SPI error interrupts.
25454  Description:
25455  This function enables SPI error interrupts.
25456  Precondition:
25457  None.
25458  Parameters:
25459  index - Identifier for the device instance to be configured
25460  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
25461  SPI interrupt error
25462  Returns:
25463  None.
25464  Example:
25465  <code>
25466  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25467  // application developer.
25468  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25469  </code>
25470  Remarks:
25471  This function implements an operation of the error interrupt control feature.
25472  This feature may not be available on all devices. Please refer to the
25473  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25474  in your application to automatically determine whether this feature is available.
25475  */
25476 
25477 void
25479  SPI_MODULE_ID index ,
25480  SPI_ERROR_INTERRUPT error ) ;
25481 //******************************************************************************
25482 /* Function:
25483  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
25484  Summary:
25485  Enables the SPI error.
25486  Description:
25487  This function enables the SPI error.
25488  This operation is atomic.
25489  Precondition:
25490  None.
25491  Parameters:
25492  index - Identifier for the device instance to be configured
25493  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25494  Returns:
25495  None.
25496  Example:
25497  <code>
25498  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25499  // application developer.
25500  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25501  </code>
25502  Remarks:
25503  This function implements an operation of the audio error control feature.
25504  This feature may not be available on all devices. Please refer to the
25505  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25506  in your application to automatically determine whether this feature is available.
25507  */
25508 
25509 void
25511  SPI_MODULE_ID index ,
25512  SPI_AUDIO_ERROR error ) ;
25513 //******************************************************************************
25514 /* Function:
25515  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
25516  Summary:
25517  Disables the SPI error.
25518  Description:
25519  This function disables the SPI error.
25520  This operation is atomic.
25521  Precondition:
25522  None.
25523  Parameters:
25524  index - Identifier for the device instance to be configured
25525  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25526  Returns:
25527  None.
25528  Example:
25529  <code>
25530  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25531  // application developer.
25532  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25533  </code>
25534  Remarks:
25535  This function implements an operation of the audio error control feature.
25536  This feature may not be available on all devices. Please refer to the
25537  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25538  in your application to automatically determine whether this feature is available.
25539  */
25540 
25541 void
25543  SPI_MODULE_ID index ,
25544  SPI_AUDIO_ERROR error ) ;
25545 //******************************************************************************
25546 /* Function:
25547  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25548  Summary:
25549  Audio protocol is enabled.
25550  Description:
25551  This function enables the audio protocol.
25552  This operation is atomic.
25553  Precondition:
25554  Disable the SPI module by calling PLIB_SPI_Disable.
25555  Parameters:
25556  index - Identifier for the device instance to be configured
25557  Returns:
25558  None.
25559  Example:
25560  <code>
25561  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25562  // application developer.
25563  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25564  </code>
25565  Remarks:
25566  This function implements an operation of the audio protocol control feature.
25567  This feature may not be available on all devices. Please refer to the
25568  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25569  in your application to automatically determine whether this feature is available.
25570  */
25571 
25572 void
25574  SPI_MODULE_ID index ) ;
25575 //******************************************************************************
25576 /* Function:
25577  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25578  Summary:
25579  Audio protocol is disabled.
25580  Description:
25581  This function disables the audio protocol.
25582  This operation is atomic.
25583  Precondition:
25584  None.
25585  Parameters:
25586  index - Identifier for the device instance to be configured
25587  Returns:
25588  None.
25589  Example:
25590  <code>
25591  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25592  // application developer.
25593  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25594  </code>
25595  Remarks:
25596  This function implements an operation of the audio protocol control feature.
25597  This feature may not be available on all devices. Please refer to the
25598  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25599  in your application to automatically determine whether this feature is available.
25600  */
25601 
25602 void
25604  SPI_MODULE_ID index ) ;
25605 //******************************************************************************
25606 /* Function:
25607  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25608  SPI_AUDIO_TRANSMIT_MODE mode)
25609  Summary:
25610  Selects the transmit audio data format.
25611  Description:
25612  This function selects the transmit audio data format.
25613  Precondition:
25614  None.
25615  Parameters:
25616  index - Identifier for the device instance to be configured
25617  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25618  transmit audio format
25619  Returns:
25620  None.
25621  Example:
25622  <code>
25623  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25624  // application developer.
25625  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25626  </code>
25627  Remarks:
25628  This function implements an operation of the audio transmit mode feature.
25629  This feature may not be available on all devices. Please refer to the
25630  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25631  in your application to automatically determine whether this feature is available.
25632  */
25633 
25634 void
25636  SPI_MODULE_ID index ,
25637  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25638 //******************************************************************************
25639 /* Function:
25640  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25641  SPI_AUDIO_PROTOCOL mode )
25642  Summary:
25643  Selects the Audio Protocol mode.
25644  Description:
25645  This function selects the Audio Protocol mode.
25646  Precondition:
25647  None.
25648  Parameters:
25649  index - Identifier for the device instance to be configured
25650  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25651  audio protocol
25652  Returns:
25653  None.
25654  Example:
25655  <code>
25656  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25657  // application developer.
25658  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25659  </code>
25660  Remarks:
25661  This function implements an operation of the audio protocol mode feature.
25662  This feature may not be available on all devices. Please refer to the
25663  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25664  in your application to automatically determine whether this feature is available.
25665  */
25666 
25667 void
25669  SPI_MODULE_ID index ,
25670  SPI_AUDIO_PROTOCOL mode ) ;
25671 // *****************************************************************************
25672 // *****************************************************************************
25673 // Section: SPI Peripheral Library Exists Functions
25674 // *****************************************************************************
25675 // *****************************************************************************
25676 /* The following functions indicate the existence of the features on the device.
25677 */
25678 //******************************************************************************
25679 /* Function:
25680  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25681  Summary:
25682  Identifies whether the EnableControl feature exists on the SPI module.
25683  Description:
25684  This function identifies whether the EnableControl feature is available on
25685  the SPI module.
25686  When this function returns true, these functions are supported on the device:
25687  - PLIB_SPI_Enable
25688  - PLIB_SPI_Disable
25689  This operation is atomic.
25690  Preconditions:
25691  None.
25692  Parameters:
25693  index - Identifier for the device instance
25694  Returns:
25695  - true - The EnableControl feature is supported on the device
25696  - false - The EnableControl feature is not supported on the device
25697  Remarks:
25698  None.
25699 */
25700 
25701 bool
25703  SPI_MODULE_ID index ) ;
25704 //******************************************************************************
25705 /* Function:
25706  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25707  Summary:
25708  Identifies whether the StopInIdle feature exists on the SPI module.
25709  Description:
25710  This function identifies whether the StopInIdle feature is available on the
25711  SPI module.
25712  When this function returns true, these functions are supported on the device:
25713  - PLIB_SPI_StopInIdleEnable
25714  - PLIB_SPI_StopInIdleDisable
25715  This operation is atomic.
25716  Preconditions:
25717  None.
25718  Parameters:
25719  index - Identifier for the device instance
25720  Returns:
25721  - true - The StopInIdle feature is supported on the device
25722  - false - The StopInIdle feature is not supported on the device
25723  Remarks:
25724  None.
25725 */
25726 
25727 bool
25729  SPI_MODULE_ID index ) ;
25730 //******************************************************************************
25731 /* Function:
25732  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25733  Summary:
25734  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25735  Description:
25736  This function identifies whether the ReceiverOverflow feature is available
25737  on the SPI module.
25738  When this function returns true, these functions are supported on the device:
25739  - PLIB_SPI_ReceiverHasOverflowed
25740  - PLIB_SPI_ReceiverOverflowClear
25741  This operation is atomic.
25742  Preconditions:
25743  None.
25744  Parameters:
25745  index - Identifier for the device instance
25746  Returns:
25747  - true - The ReceiverOverflow feature is supported on the device
25748  - false - The ReceiverOverflow feature is not supported on the device
25749  Remarks:
25750  None.
25751 */
25752 
25753 bool
25755  SPI_MODULE_ID index ) ;
25756 //******************************************************************************
25757 /* Function:
25758  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25759  Summary:
25760  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25761  Description:
25762  This function identifies whether the TransmitBufferFullStatus feature is available
25763  on the SPI module.
25764  When this function returns true, this function is supported on the device:
25765  - PLIB_SPI_TransmitBufferIsFull
25766  This operation is atomic.
25767  Preconditions:
25768  None.
25769  Parameters:
25770  index - Identifier for the device instance
25771  Returns:
25772  - true - The TransmitBufferFullStatus feature is supported on the device
25773  - false - The TransmitBufferFullStatus feature is not supported on the device
25774  Remarks:
25775  None.
25776 */
25777 
25778 bool
25780  SPI_MODULE_ID index ) ;
25781 //******************************************************************************
25782 /* Function:
25783  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25784  Summary:
25785  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25786  Description:
25787  This function identifies whether the TransmitBufferEmptyStatus feature is available
25788  on the SPI module.
25789  When this function returns true, this function is supported on the device:
25790  - PLIB_SPI_TransmitBufferIsEmpty
25791  This operation is atomic.
25792  Preconditions:
25793  None.
25794  Parameters:
25795  index - Identifier for the device instance
25796  Returns:
25797  - true - The TransmitBufferEmptyStatus feature is supported on the device
25798  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25799  Remarks:
25800  None.
25801 */
25802 
25803 bool
25805  SPI_MODULE_ID index ) ;
25806 //******************************************************************************
25807 /* Function:
25808  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25809  Summary:
25810  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25811  Description:
25812  This function identifies whether the ReceiveBufferStatus feature is available
25813  on the SPI module.
25814  When this function returns true, this function is supported on the device:
25815  - PLIB_SPI_ReceiverBufferIsFull
25816  This operation is atomic.
25817  Preconditions:
25818  None.
25819  Parameters:
25820  index - Identifier for the device instance
25821  Returns:
25822  - true - The ReceiveBufferStatus feature is supported on the device
25823  - false - The ReceiveBufferStatus feature is not supported on the device
25824  Remarks:
25825  None.
25826 */
25827 
25828 bool
25830  SPI_MODULE_ID index ) ;
25831 //******************************************************************************
25832 /* Function:
25833  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25834  Summary:
25835  Identifies whether the PinControl feature exists on the SPI module.
25836  Description:
25837  This function identifies whether the PinControl feature is available on the
25838  SPI module.
25839  When this function returns true, these functions are supported on the device:
25840  - PLIB_SPI_PinEnable
25841  - PLIB_SPI_PinDisable
25842  This operation is atomic.
25843  Preconditions:
25844  None.
25845  Parameters:
25846  index - Identifier for the device instance
25847  Returns:
25848  - true - The PinControl feature is supported on the device
25849  - false - The PinControl feature is not supported on the device
25850  Remarks:
25851  None.
25852 */
25853 
25854 bool
25856  SPI_MODULE_ID index ) ;
25857 //******************************************************************************
25858 /* Function:
25859  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25860  Summary:
25861  Identifies whether the CommunicationWidth feature exists on the SPI module.
25862  Description:
25863  This function identifies whether the CommunicationWidth feature is available
25864  on the SPI module.
25865  When this function returns true, this function is supported on the device:
25866  - PLIB_SPI_CommunicationWidthSelect
25867  This operation is atomic.
25868  Preconditions:
25869  None.
25870  Parameters:
25871  index - Identifier for the device instance
25872  Returns:
25873  - true - The CommunicationWidth feature is supported on the device
25874  - false - The CommunicationWidth feature is not supported on the device
25875  Remarks:
25876  None.
25877 */
25878 
25879 bool
25881  SPI_MODULE_ID index ) ;
25882 //******************************************************************************
25883 /* Function:
25884  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25885  Summary:
25886  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25887  Description:
25888  This function identifies whether the AudioCommunicationWidth feature is available
25889  on the SPI module.
25890  When this function returns true, this function is supported on the device:
25891  - PLIB_SPI_AudioCommunicationWidthSelect
25892  This operation is atomic.
25893  Preconditions:
25894  None.
25895  Parameters:
25896  index - Identifier for the device instance
25897  Returns:
25898  - true - The AudioCommunicationWidth feature is supported on the device
25899  - false - The AudioCommunicationWidth feature is not supported on the device
25900  Remarks:
25901  None.
25902 */
25903 
25904 bool
25906  SPI_MODULE_ID index ) ;
25907 //******************************************************************************
25908 /* Function:
25909  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25910  Summary:
25911  Identifies whether the InputSamplePhase feature exists on the SPI module.
25912  Description:
25913  This function identifies whether the InputSamplePhase feature is available
25914  on the SPI module.
25915  When this function returns true, this function is supported on the device:
25916  - PLIB_SPI_InputSamplePhaseSelect
25917  This operation is atomic.
25918  Preconditions:
25919  None.
25920  Parameters:
25921  index - Identifier for the device instance
25922  Returns:
25923  - true - The InputSamplePhase feature is supported on the device
25924  - false - The InputSamplePhase feature is not supported on the device
25925  Remarks:
25926  None.
25927 */
25928 
25929 bool
25931  SPI_MODULE_ID index ) ;
25932 //******************************************************************************
25933 /* Function:
25934  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25935  Summary:
25936  Identifies whether the OutputDataPhase feature exists on the SPI module.
25937  Description:
25938  This function identifies whether the OutputDataPhase feature is available on
25939  the SPI module.
25940  When this function returns true, this function is supported on the device:
25941  - PLIB_SPI_OutputDataPhaseSelect
25942  This operation is atomic.
25943  Preconditions:
25944  None.
25945  Parameters:
25946  index - Identifier for the device instance
25947  Returns:
25948  - true - The OutputDataPhase feature is supported on the device
25949  - false - The OutputDataPhase feature is not supported on the device
25950  Remarks:
25951  None.
25952 */
25953 
25954 bool
25956  SPI_MODULE_ID index ) ;
25957 //******************************************************************************
25958 /* Function:
25959  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25960  Summary:
25961  Identifies whether the ClockPolarity feature exists on the SPI module.
25962  Description:
25963  This function identifies whether the ClockPolarity feature is available on
25964  the SPI module.
25965  When this function returns true, this function is supported on the device:
25966  - PLIB_SPI_ClockPolaritySelect
25967  This operation is atomic.
25968  Preconditions:
25969  None.
25970  Parameters:
25971  index - Identifier for the device instance
25972  Returns:
25973  - true - The ClockPolarity feature is supported on the device
25974  - false - The ClockPolarity feature is not supported on the device
25975  Remarks:
25976  None.
25977 */
25978 
25979 bool
25981  SPI_MODULE_ID index ) ;
25982 //******************************************************************************
25983 /* Function:
25984  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25985  Summary:
25986  Identifies whether the MasterControl feature exists on the SPI module.
25987  Description:
25988  This function identifies whether the MasterControl feature is available on
25989  the SPI module.
25990  When this function returns true, these functions are supported on the device:
25991  - PLIB_SPI_MasterEnable
25992  - PLIB_SPI_SlaveEnable
25993  This operation is atomic.
25994  Preconditions:
25995  None.
25996  Parameters:
25997  index - Identifier for the device instance
25998  Returns:
25999  - true - The MasterControl feature is supported on the device
26000  - false - The MasterControl feature is not supported on the device
26001  Remarks:
26002  None.
26003 */
26004 
26005 bool
26007  SPI_MODULE_ID index ) ;
26008 //******************************************************************************
26009 /* Function:
26010  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
26011  Summary:
26012  Identifies whether the BaudRate feature exists on the SPI module.
26013  Description:
26014  This function identifies whether the BaudRate feature is available on the SPI
26015  module.
26016  When this function returns true, this function is supported on the device:
26017  - PLIB_SPI_BaudRateSet
26018  This operation is atomic.
26019  Preconditions:
26020  None.
26021  Parameters:
26022  index - Identifier for the device instance
26023  Returns:
26024  - true - The BaudRate feature is supported on the device
26025  - false - The BaudRate feature is not supported on the device
26026  Remarks:
26027  None.
26028 */
26029 
26030 bool
26032  SPI_MODULE_ID index ) ;
26033 //******************************************************************************
26034 /* Function:
26035  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
26036  Summary:
26037  Identifies whether the BusStatus feature exists on the SPI module.
26038  Description:
26039  This function identifies whether the BusStatus feature is available on the
26040  SPI module.
26041  When this function returns true, this function is supported on the device:
26042  - PLIB_SPI_IsBusy
26043  This operation is atomic.
26044  Preconditions:
26045  None.
26046  Parameters:
26047  index - Identifier for the device instance
26048  Returns:
26049  - true - The BusStatus feature is supported on the device
26050  - false - The BusStatus feature is not supported on the device
26051  Remarks:
26052  None.
26053 */
26054 
26055 bool
26057  SPI_MODULE_ID index ) ;
26058 //******************************************************************************
26059 /* Function:
26060  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
26061  Summary:
26062  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
26063  Description:
26064  This function identifies whether the ReadDataSignStatus feature is available
26065  on the SPI module.
26066  When this function returns true, this function is supported on the device:
26067  - PLIB_SPI_ReadDataIsSignExtended
26068  This operation is atomic.
26069  Preconditions:
26070  None.
26071  Parameters:
26072  index - Identifier for the device instance
26073  Returns:
26074  - true - The ReadDataSignStatus feature is supported on the device
26075  - false - The ReadDataSignStatus feature is not supported on the device
26076  Remarks:
26077  None.
26078 */
26079 
26080 bool
26082  SPI_MODULE_ID index ) ;
26083 //******************************************************************************
26084 /* Function:
26085  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
26086  Summary:
26087  Identifies whether the SlaveSelectControl feature exists on the SPI module.
26088  Description:
26089  This function identifies whether the SlaveSelectControl feature is available
26090  on the SPI module.
26091  When this function returns true, these functions are supported on the device:
26092  - PLIB_SPI_SlaveSelectEnable
26093  - PLIB_SPI_SlaveSelectDisable
26094  This operation is atomic.
26095  Preconditions:
26096  None.
26097  Parameters:
26098  index - Identifier for the device instance
26099  Returns:
26100  - true - The SlaveSelectControl feature is supported on the device
26101  - false - The SlaveSelectControl feature is not supported on the device
26102  Remarks:
26103  None.
26104 */
26105 
26106 bool
26108  SPI_MODULE_ID index ) ;
26109 //******************************************************************************
26110 /* Function:
26111  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
26112  Summary:
26113  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
26114  Description:
26115  This function identifies whether the TransmitUnderRunStatus feature is available
26116  on the SPI module.
26117  When this function returns true, these functions are supported on the device:
26118  - PLIB_SPI_TransmitUnderRunStatusGet
26119  - PLIB_SPI_TransmitUnderRunStatusClear
26120  This operation is atomic.
26121  Preconditions:
26122  None.
26123  Parameters:
26124  index - Identifier for the device instance
26125  Returns:
26126  - true - The TransmitUnderRunStatus feature is supported on the device
26127  - false - The TransmitUnderRunStatus feature is not supported on the device
26128  Remarks:
26129  None.
26130 */
26131 
26132 bool
26134  SPI_MODULE_ID index ) ;
26135 //******************************************************************************
26136 /* Function:
26137  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
26138  Summary:
26139  Identifies whether the FIFOControl feature exists on the SPI module.
26140  Description:
26141  This function identifies whether the FIFOControl feature is available on the
26142  SPI module.
26143  When this function returns true, these functions are supported on the device:
26144  - PLIB_SPI_FIFOEnable
26145  - PLIB_SPI_FIFODisable
26146  This operation is atomic.
26147  Preconditions:
26148  None.
26149  Parameters:
26150  index - Identifier for the device instance
26151  Returns:
26152  - true - The FIFOControl feature is supported on the device
26153  - false - The FIFOControl feature is not supported on the device
26154  Remarks:
26155  None.
26156 */
26157 
26158 bool
26160  SPI_MODULE_ID index ) ;
26161 //******************************************************************************
26162 /* Function:
26163  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
26164  Summary:
26165  Identifies whether the FIFOCount feature exists on the SPI module.
26166  Description:
26167  This function identifies whether the FIFOCount feature is available on the SPI module.
26168  When this function returns true, this function is supported on the device:
26169  - PLIB_SPI_FIFOCountGet
26170  This operation is atomic.
26171  Preconditions:
26172  None.
26173  Parameters:
26174  index - Identifier for the device instance
26175  Returns:
26176  - true - The FIFOCount feature is supported on the device
26177  - false - The FIFOCount feature is not supported on the device
26178  Remarks:
26179  None.
26180 */
26181 
26182 bool
26184  SPI_MODULE_ID index ) ;
26185 //******************************************************************************
26186 /* Function:
26187  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
26188  Summary:
26189  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
26190  Description:
26191  This function identifies whether the ReceiveFIFOStatus feature is available
26192  on the SPI module.
26193  When this function returns true, this function is supported on the device:
26194  - PLIB_SPI_ReceiverFIFOIsEmpty
26195  This operation is atomic.
26196  Preconditions:
26197  None.
26198  Parameters:
26199  index - Identifier for the device instance
26200  Returns:
26201  - true - The ReceiveFIFOStatus feature is supported on the device
26202  - false - The ReceiveFIFOStatus feature is not supported on the device
26203  Remarks:
26204  None.
26205 */
26206 
26207 bool
26209  SPI_MODULE_ID index ) ;
26210 //******************************************************************************
26211 /* Function:
26212  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
26213  Summary:
26214  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
26215  Description:
26216  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
26217  available on the SPI module.
26218  When this function returns true, this function is supported on the device:
26219  - PLIB_SPI_FIFOShiftRegisterIsEmpty
26220  This operation is atomic.
26221  Preconditions:
26222  None.
26223  Parameters:
26224  index - Identifier for the device instance
26225  Returns:
26226  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
26227  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
26228  Remarks:
26229  None.
26230 */
26231 
26232 bool
26234  SPI_MODULE_ID index ) ;
26235 //******************************************************************************
26236 /* Function:
26237  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
26238  Summary:
26239  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
26240  Description:
26241  This function identifies whether the FIFOInterruptMode feature is available
26242  on the SPI module.
26243  When this function returns true, this function is supported on the device:
26244  - PLIB_SPI_FIFOInterruptModeSelect
26245  This operation is atomic.
26246  Preconditions:
26247  None.
26248  Parameters:
26249  index - Identifier for the device instance
26250  Returns:
26251  - true - The FIFOInterruptMode feature is supported on the device
26252  - false - The FIFOInterruptMode feature is not supported on the device
26253  Remarks:
26254  None.
26255 */
26256 
26257 bool
26259  SPI_MODULE_ID index ) ;
26260 //******************************************************************************
26261 /* Function:
26262  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
26263  Summary:
26264  Identifies whether the FramedCommunication feature exists on the SPI module.
26265  Description:
26266  This function identifies whether the FramedCommunication feature is available
26267  on the SPI module.
26268  When this function returns true, these functions are supported on the device:
26269  - PLIB_SPI_FramedCommunicationEnable
26270  - PLIB_SPI_FramedCommunicationDisable
26271  This operation is atomic.
26272  Preconditions:
26273  None.
26274  Parameters:
26275  index - Identifier for the device instance
26276  Returns:
26277  - true - The FramedCommunication feature is supported on the device
26278  - false - The FramedCommunication feature is not supported on the device
26279  Remarks:
26280  None.
26281 */
26282 
26283 bool
26285  SPI_MODULE_ID index ) ;
26286 //******************************************************************************
26287 /* Function:
26288  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
26289  Summary:
26290  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
26291  Description:
26292  This function identifies whether the FrameSyncPulseDirection feature is available
26293  on the SPI module.
26294  When this function returns true, this function is supported on the device:
26295  - PLIB_SPI_FrameSyncPulseDirectionSelect
26296  This operation is atomic.
26297  Preconditions:
26298  None.
26299  Parameters:
26300  index - Identifier for the device instance
26301  Returns:
26302  - true - The FrameSyncPulseDirection feature is supported on the device
26303  - false - The FrameSyncPulseDirection feature is not supported on the device
26304  Remarks:
26305  None.
26306 */
26307 
26308 bool
26310  SPI_MODULE_ID index ) ;
26311 //******************************************************************************
26312 /* Function:
26313  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
26314  Summary:
26315  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
26316  Description:
26317  This function identifies whether the FrameSyncPulsePolarity feature is available
26318  on the SPI module.
26319  When this function returns true, this function is supported on the device:
26320  - PLIB_SPI_FrameSyncPulsePolaritySelect
26321  This operation is atomic.
26322  Preconditions:
26323  None.
26324  Parameters:
26325  index - Identifier for the device instance
26326  Returns:
26327  - true - The FrameSyncPulsePolarity feature is supported on the device
26328  - false - The FrameSyncPulsePolarity feature is not supported on the device
26329  Remarks:
26330  None.
26331 */
26332 
26333 bool
26335  SPI_MODULE_ID index ) ;
26336 //******************************************************************************
26337 /* Function:
26338  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
26339  Summary:
26340  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
26341  Description:
26342  This function identifies whether the FrameSyncPulseEdge feature is available
26343  on the SPI module.
26344  When this function returns true, this function is supported on the device:
26345  - PLIB_SPI_FrameSyncPulseEdgeSelect
26346  This operation is atomic.
26347  Preconditions:
26348  None.
26349  Parameters:
26350  index - Identifier for the device instance
26351  Returns:
26352  - true - The FrameSyncPulseEdge feature is supported on the device
26353  - false - The FrameSyncPulseEdge feature is not supported on the device
26354  Remarks:
26355  None.
26356 */
26357 
26358 bool
26360  SPI_MODULE_ID index ) ;
26361 //******************************************************************************
26362 /* Function:
26363  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
26364  Summary:
26365  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
26366  Description:
26367  This function identifies whether the FrameSyncPulseWidth feature is available
26368  on the SPI module.
26369  When this function returns true, this function is supported on the device:
26370  - PLIB_SPI_FrameSyncPulseWidthSelect
26371  This operation is atomic.
26372  Preconditions:
26373  None.
26374  Parameters:
26375  index - Identifier for the device instance
26376  Returns:
26377  - true - The FrameSyncPulseWidth feature is supported on the device
26378  - false - The FrameSyncPulseWidth feature is not supported on the device
26379  Remarks:
26380  None.
26381 */
26382 
26383 bool
26385  SPI_MODULE_ID index ) ;
26386 //******************************************************************************
26387 /* Function:
26388  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
26389  Summary:
26390  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
26391  Description:
26392  This function identifies whether the FrameSyncPulseCounter feature is available
26393  on the SPI module.
26394  When this function returns true, this function is supported on the device:
26395  - PLIB_SPI_FrameSyncPulseCounterSelect
26396  This operation is atomic.
26397  Preconditions:
26398  None.
26399  Parameters:
26400  index - Identifier for the device instance
26401  Returns:
26402  - true - The FrameSyncPulseCounter feature is supported on the device
26403  - false - The FrameSyncPulseCounter feature is not supported on the device
26404  Remarks:
26405  None.
26406 */
26407 
26408 bool
26410  SPI_MODULE_ID index ) ;
26411 //******************************************************************************
26412 /* Function:
26413  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
26414  Summary:
26415  Identifies whether the FrameErrorStatus feature exists on the SPI module.
26416  Description:
26417  This function identifies whether the FrameErrorStatus feature is available on
26418  the SPI module.
26419  When this function returns true, these functions are supported on the device:
26420  - PLIB_SPI_FrameErrorStatusGet
26421  - PLIB_SPI_FrameErrorStatusClear
26422  This operation is atomic.
26423  Preconditions:
26424  None.
26425  Parameters:
26426  index - Identifier for the device instance
26427  Returns:
26428  - true - The FrameErrorStatus feature is supported on the device
26429  - false - The FrameErrorStatus feature is not supported on the device
26430  Remarks:
26431  None.
26432 */
26433 
26434 bool
26436  SPI_MODULE_ID index ) ;
26437 //******************************************************************************
26438 /* Function:
26439  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
26440  Summary:
26441  Identifies whether the Buffer feature exists on the SPI module.
26442  Description:
26443  This function identifies whether the Buffer feature is available on the SPI module.
26444  When this function returns true, these functions are supported on the device:
26445  - PLIB_SPI_BufferClear
26446  - PLIB_SPI_BufferRead
26447  - PLIB_SPI_BufferWrite
26448  - PLIB_SPI_BufferAddressGet
26449  This operation is atomic.
26450  Preconditions:
26451  None.
26452  Parameters:
26453  index - Identifier for the device instance
26454  Returns:
26455  - true - The Buffer feature is supported on the device
26456  - false - The Buffer feature is not supported on the device
26457  Remarks:
26458  None.
26459 */
26460 
26461 bool
26463  SPI_MODULE_ID index ) ;
26464 //******************************************************************************
26465 /* Function:
26466  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
26467  Summary:
26468  Identifies whether the BaudRateClock feature exists on the SPI module.
26469  Description:
26470  This function identifies whether the BaudRateClock feature is available on
26471  the SPI module.
26472  When this function returns true, this function is supported on the device:
26473  - PLIB_SPI_BaudRateClockSelect
26474  This operation is atomic.
26475  Preconditions:
26476  None.
26477  Parameters:
26478  index - Identifier for the device instance
26479  Returns:
26480  - true - The BaudRateClock feature is supported on the device
26481  - false - The BaudRateClock feature is not supported on the device
26482  Remarks:
26483  None.
26484 */
26485 
26486 bool
26488  SPI_MODULE_ID index ) ;
26489 //******************************************************************************
26490 /* Function:
26491  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
26492  Summary:
26493  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
26494  Description:
26495  This function identifies whether the ErrorInterruptControl feature is available
26496  on the SPI module.
26497  When this function returns true, these functions are supported on the device:
26498  - PLIB_SPI_ErrorInterruptEnable
26499  - PLIB_SPI_ErrorInterruptDisable
26500  This operation is atomic.
26501  Preconditions:
26502  None.
26503  Parameters:
26504  index - Identifier for the device instance
26505  Returns:
26506  - true - The ErrorInterruptControl feature is supported on the device
26507  - false - The ErrorInterruptControl feature is not supported on the device
26508  Remarks:
26509  None.
26510 */
26511 
26512 bool
26514  SPI_MODULE_ID index ) ;
26515 //******************************************************************************
26516 /* Function:
26517  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
26518  Summary:
26519  Identifies whether the AudioErrorControl feature exists on the SPI module.
26520  Description:
26521  This function identifies whether the AudioErrorControl feature is available
26522  on the SPI module.
26523  When this function returns true, these functions are supported on the device:
26524  - PLIB_SPI_AudioErrorEnable
26525  - PLIB_SPI_AudioErrorDisable
26526  This operation is atomic.
26527  Preconditions:
26528  None.
26529  Parameters:
26530  index - Identifier for the device instance
26531  Returns:
26532  - true - The AudioErrorControl feature is supported on the device
26533  - false - The AudioErrorControl feature is not supported on the device
26534  Remarks:
26535  None.
26536 */
26537 
26538 bool
26540  SPI_MODULE_ID index ) ;
26541 //******************************************************************************
26542 /* Function:
26543  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
26544  Summary:
26545  Identifies whether the AudioProtocolControl feature exists on the SPI module.
26546  Description:
26547  This function identifies whether the AudioProtocolControl feature is available
26548  on the SPI module.
26549  When this function returns true, this function is supported on the device:
26550  - PLIB_SPI_AudioProtocolEnable
26551  - PLIB_SPI_AudioProtocolDisable
26552  This operation is atomic.
26553  Preconditions:
26554  None.
26555  Parameters:
26556  index - Identifier for the device instance
26557  Returns:
26558  - true - The AudioProtocolControl feature is supported on the device
26559  - false - The AudioProtocolControl feature is not supported on the device
26560  Remarks:
26561  None.
26562 */
26563 
26564 bool
26566  SPI_MODULE_ID index ) ;
26567 //******************************************************************************
26568 /* Function:
26569  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26570  Summary:
26571  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26572  Description:
26573  This function identifies whether the AudioTransmitMode feature is available
26574  on the SPI module.
26575  When this function returns true, this function is supported on the device:
26576  - PLIB_SPI_AudioTransmitModeSelect
26577  This operation is atomic.
26578  Preconditions:
26579  None.
26580  Parameters:
26581  index - Identifier for the device instance
26582  Returns:
26583  - true - The AudioTransmitMode feature is supported on the device
26584  - false - The AudioTransmitMode feature is not supported on the device
26585  Remarks:
26586  None.
26587 */
26588 
26589 bool
26591  SPI_MODULE_ID index ) ;
26592 //******************************************************************************
26593 /* Function:
26594  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26595  Summary:
26596  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26597  Description:
26598  This function identifies whether the AudioProtocolMode feature is available
26599  on the SPI module.
26600  When this function returns true, this function is supported on the device:
26601  - PLIB_SPI_AudioProtocolModeSelect
26602  This operation is atomic.
26603  Preconditions:
26604  None.
26605  Parameters:
26606  index - Identifier for the device instance
26607  Returns:
26608  - true - The AudioProtocolMode feature is supported on the device
26609  - false - The AudioProtocolMode feature is not supported on the device
26610  Remarks:
26611  None.
26612 */
26613 
26614 bool
26616  SPI_MODULE_ID index ) ;
26617 //******************************************************************************
26618 /* Function:
26619  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26620  Summary:
26621  Identifies whether the Buffer32bit feature exists on the SPI module.
26622  Description:
26623  This function identifies whether the Buffer32bit feature is available on the
26624  SPI module.
26625  When this function returns true, these functions are supported on the device:
26626  - PLIB_SPI_BufferRead32bit
26627  - PLIB_SPI_BufferWrite32bit
26628  This operation is atomic.
26629  Preconditions:
26630  None.
26631  Parameters:
26632  index - Identifier for the device instance
26633  Returns:
26634  - true - The Buffer32bit feature is supported on the device
26635  - false - The Buffer32bit feature is not supported on the device
26636  Remarks:
26637  None.
26638 */
26639 
26640 bool
26642  SPI_MODULE_ID index ) ;
26643 //******************************************************************************
26644 /* Function:
26645  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26646  Summary:
26647  Identifies whether the Buffer16bit feature exists on the SPI module.
26648  Description:
26649  This function identifies whether the Buffer16bit feature is available on the
26650  SPI module.
26651  When this function returns true, these functions are supported on the device:
26652  - PLIB_SPI_BufferRead16bit
26653  - PLIB_SPI_BufferWrite16bit
26654  This operation is atomic.
26655  Preconditions:
26656  None.
26657  Parameters:
26658  index - Identifier for the device instance
26659  Returns:
26660  - true - The Buffer16bit feature is supported on the device
26661  - false - The Buffer16bit feature is not supported on the device
26662  Remarks:
26663  None.
26664 */
26665 
26666 bool
26668  SPI_MODULE_ID index ) ;
26669 //DOM-IGNORE-BEGIN
26670 //DOM-IGNORE-END
26671  // #ifndef _PLIB_SPI_H
26672 /*******************************************************************************
26673  End of File
26674  */
26675 
26676 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26677 /* CLOSE_FILE Include File */
26678 
26679  // SPI PLIB Header
26680 #include "system/common/sys_common.h" // Common System Service Definitions
26681 #include "system/common/sys_module.h" // Module/Driver Definitions
26682 #include "system/int/sys_int.h" // System Interrupt Definitions
26683 #include "system/clk/sys_clk.h"
26684 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26685  /* LDRA full path */
26686 // DOM-IGNORE-BEGIN
26687 // DOM-IGNORE-END
26688 // *****************************************************************************
26689 /* SPI Driver Buffer Handle
26690  Summary:
26691  Handle identifying a read or write buffer passed to the driver.
26692  Description:
26693  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26694  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26695  This handle is associated with the buffer passed into the function and
26696  it allows the application to track the completion of the data from (or into)
26697  that buffer. The buffer handle value returned from the "buffer add" function
26698  is returned back to the client by the "callback" function registered with
26699  the driver.
26700  The buffer handle assigned to a client request expires when the client has
26701  been notified of the completion of the buffer transfer (after event handler
26702  function that notifies the client returns) or after the buffer has been
26703  retired by the driver if no event handler callback was set.
26704  Remarks:
26705  None.
26706 */
26707 
26708 typedef
26709 uintptr_t
26711 // *****************************************************************************
26712 /* SPI Driver Invalid Buffer Handle
26713  Summary:
26714  Definition of an invalid buffer handle.
26715  Description:
26716  This is the definition of an invalid buffer handle. An invalid buffer handle
26717  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26718  function if the buffer add request was not successful.
26719  Remarks:
26720  None.
26721 */
26722 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26723 // *****************************************************************************
26724 /* SPI Driver Module Index Numbers
26725  Summary:
26726  SPI driver index definitions.
26727  Description:
26728  These constants provide the SPI driver index definitions.
26729  Remarks:
26730  These constants should be used in place of hard-coded numeric literals.
26731  These values should be passed into the DRV_SPI_Initialize and
26732  DRV_SPI_Open functions to identify the driver instance in use.
26733 */
26734 #define DRV_SPI_INDEX_0 0
26735 #define DRV_SPI_INDEX_1 1
26736 #define DRV_SPI_INDEX_2 2
26737 #define DRV_SPI_INDEX_3 3
26738 #define DRV_SPI_INDEX_4 4
26739 #define DRV_SPI_INDEX_5 5
26740 // *****************************************************************************
26741 /* SPI Driver Module Index Count
26742  Summary:
26743  Number of valid SPI driver indices.
26744  Description:
26745  This constant identifies the number of valid SPI driver indices.
26746  Remarks:
26747  This constant should be used in place of hard-coded numeric literals.
26748  This value is derived from device-specific header files defined as part
26749  of the peripheral libraries.
26750 */
26751 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26752 // *****************************************************************************
26753 /* SPI Clock Mode Selection
26754  Summary:
26755  Identifies the various clock modes of the SPI module.
26756  Description:
26757  This enumeration identifies the various clock modes of the SPI module.
26758  Remarks:
26759  None.
26760 */
26761 
26762 typedef
26763  enum
26764  {
26765  /* SPI Clock Mode 0:
26766  - Idle State of the clock is Low
26767  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26768  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26770  /*DOM-IGNORE-BEGIN*/
26771  = 0 /*DOM-IGNORE-END*/
26772  ,
26773  /* SPI Clock Mode 1:
26774  - Idle State of the clock is Low
26775  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26776  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26778  /*DOM-IGNORE-BEGIN*/
26779  = 1 /*DOM-IGNORE-END*/
26780  ,
26781  /* SPI Clock Mode 2:
26782  - Idle State of the clock is High
26783  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26784  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26786  /*DOM-IGNORE-BEGIN*/
26787  = 2 /*DOM-IGNORE-END*/
26788  ,
26789  /* SPI Clock Mode 3:
26790  - Idle State of the clock is High
26791  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26792  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26794  /*DOM-IGNORE-BEGIN*/
26795  = 3 /*DOM-IGNORE-END*/
26796  } DRV_SPI_CLOCK_MODE ;
26797 // *****************************************************************************
26798 /* SPI Buffer Type Selection
26799  Summary:
26800  Identifies the various buffer types of the SPI module.
26801  Description:
26802  This enumeration identifies the various buffer types of the SPI module.
26803  Remarks:
26804  None.
26805 */
26806 
26807 typedef
26808  enum
26809  {
26810  /* SPI Buffer Type Standard */
26812  /*DOM-IGNORE-BEGIN*/
26813  = 0 /*DOM-IGNORE-END*/
26814  ,
26815  /* SPI Enhanced Buffer Type */
26817  /*DOM-IGNORE-BEGIN*/
26818  = 1 /*DOM-IGNORE-END*/
26820 // *****************************************************************************
26821 /* SPI Protocols Enumeration
26822  Summary:
26823  Identifies the various protocols of the SPI module.
26824  Description:
26825  This enumeration identifies the various protocols of the SPI module.
26826  Remarks:
26827  None.
26828 */
26829 
26830 typedef
26831  enum
26832  {
26833  /* SPI Protocol Type Standard */
26835  /*DOM-IGNORE-BEGIN*/
26836  = 0 /*DOM-IGNORE-END*/
26837  ,
26838  /* SPI Protocol Type Framed */
26840  /*DOM-IGNORE-BEGIN*/
26841  = 1 /*DOM-IGNORE-END*/
26842  ,
26843  /*SPI Protocol Type Audio*/
26845  /*DOM-IGNORE-BEGIN*/
26846  = 2 /*DOM-IGNORE-END*/
26848 // *****************************************************************************
26849 /* SPI Driver Buffer Events
26850  Summary
26851  Identifies the possible events that can result from a buffer add request.
26852  Description
26853  This enumeration identifies the possible events that can result from a
26854  buffer add request caused by the client calling either
26855  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26856  Remarks:
26857  One of these values is passed in the "event" parameter of the event
26858  handling callback function that the client registered during buffer add
26859  requests.
26860 */
26861 
26862 typedef
26863  enum
26864  {
26865  /* Buffer is pending to get processed */
26867  /* Buffer is being processed */
26869  /* All data from or to the buffer was transferred successfully. */
26871  /* There was an error while processing the buffer transfer request. */
26874 // *****************************************************************************
26875 /* SPI Usage Modes Enumeration
26876  Summary:
26877  Identifies the various usage modes of the SPI module.
26878  Description:
26879  This enumeration identifies the various usage modes of the SPI module.
26880  Remarks:
26881  None.
26882 */
26883 
26884 typedef
26885  enum
26886  {
26887  /* SPI Mode Master */
26889  /*DOM-IGNORE-BEGIN*/
26890  = 0 /*DOM-IGNORE-END*/
26891  ,
26892  /* SPI Mode Slave */
26894  /*DOM-IGNORE-BEGIN*/
26895  = 1 /*DOM-IGNORE-END*/
26896  } DRV_SPI_MODE ;
26897 // *****************************************************************************
26898 /* SPI Task Modes Enumeration
26899  Summary:
26900  Identifies the various modes of how the tasks function will be run.
26901  Description:
26902  This enumeration identifies the various tasks mode
26903  Remarks:
26904  None.
26905 */
26906 
26907 typedef
26908  enum
26909  {
26910  /* Task is configured to run in polled mode */
26912  /*DOM-IGNORE-BEGIN*/
26913  = 0 /*DOM-IGNORE-END*/
26914  ,
26915  /* Task is configured to run in interrupt mode */
26917  /*DOM-IGNORE-BEGIN*/
26918  = 1 /*DOM-IGNORE-END*/
26919  } DRV_SPI_TASK_MODE ;
26920 // *****************************************************************************
26921 /* SPI Driver Buffer Event Handler Function Pointer
26922  Summary:
26923  Pointer to a SPI Driver Buffer Event handler function
26924  Description:
26925  This data type defines the required function signature for the SPI driver
26926  buffer event handling callback function. A client must register a pointer
26927  to a buffer event handling function who's function signature (parameter
26928  and return value types) match the types specified by this function pointer
26929  in order to receive buffer related event calls back from the driver.
26930  The parameters and return values and return value are described here and
26931  a partial example implementation is provided.
26932  Parameters:
26933  event - Identifies the type of event
26934  bufferHandle - Handle identifying the buffer to which the vent relates
26935  context - Value identifying the context of the application that
26936  registered the event handling function.
26937  Returns:
26938  None.
26939  Example:
26940  <code>
26941  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26942  DRV_SPI_BUFFER_HANDLE bufferHandle,
26943  uintptr_t context )
26944  {
26945  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26946  switch(event)
26947  {
26948  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26949  // Handle the completed buffer.
26950  break;
26951  case DRV_SPI_BUFFER_EVENT_ERROR:
26952  default:
26953  // Handle error.
26954  break;
26955  }
26956  }
26957  </code>
26958  Remarks:
26959  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26960  transferred successfully.
26961  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26962  not transferred successfully.
26963  The bufferHandle parameter contains the buffer handle of the buffer that
26964  failed.
26965  The context parameter contains the a handle to the client context,
26966  provided at the time the event handling function registration.
26967  This context handle value is passed back to the client as the "context"
26968  parameter. It can be any value necessary to identify the client context
26969  or instance (such as a pointer to the client's data) instance of the
26970  client that made the buffer add request.
26971  The event handler function executes in an interrupt context when the driver
26972  is configured for interrupt mode operation. It is recommended of the
26973  application to not perform process intensive operations with in this
26974  function.
26975 */
26976 
26977 typedef
26979 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26980 void * context ) ;
26981 // *****************************************************************************
26982 /* SPI Driver Initialization Data
26983  Summary:
26984  Defines the data required to initialize or reinitialize the SPI driver
26985  Description:
26986  This data type defines the data required to initialize or reinitialize the
26987  SPI driver. If the driver is built statically, the members of this data
26988  structure are statically over-ridden by static override definitions in the
26989  system_config.h file.
26990  Remarks:
26991  None.
26992 */
26993 
26994 typedef
26995 struct _DRV_SPI_INIT
26996 {
26997  /* System module initialization */
26998  SYS_MODULE_INIT moduleInit ;
26999  /* Identifies peripheral (PLIB-level) ID */
27000  SPI_MODULE_ID spiId ;
27001  /* SPI Task Mode Type*/
27003  /* SPI Usage Mode Type */
27005  /* Allow SPI to run when CPU goes to idle mode*/
27006  bool allowIdleRun ;
27007  /* SPI Protocol Type */
27009  /* SPI Slave Mode SSx Pin Select */
27010  bool spiSlaveSSPin ;
27011  /* Framed mode Sync Pulse*/
27012  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
27013  /* Framed Mode pulse polarity*/
27014  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
27015  /* Framed Mode Pulse Direction*/
27016  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
27017  /* Framed mode Pulse Edge*/
27018  SPI_FRAME_PULSE_EDGE framePulseEdge ;
27019  /* Framed Mode Pulse width */
27020  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
27021  /* Audio mode transmit mode*/
27022  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
27023  /* Audio mode protocol mode*/
27024  SPI_AUDIO_PROTOCOL audioProtocolMode ;
27025  /* Communication Width */
27026  SPI_COMMUNICATION_WIDTH commWidth ;
27027  /* SPI clock source which generates required baud rate.
27028  It can be either PBCLK or Reference Clock */
27029  SPI_BAUD_RATE_CLOCK baudClockSource ;
27030  /* when Baud rate clock source is peripheral clock, then this element is
27031  used to define which peripheral bus clock is used for this particular
27032  SPI instance. */
27033  CLK_BUSES_PERIPHERAL spiClk ;
27034  /* Baud Rate Value */
27035  uint32_t baudRate ;
27036  /* SPI Buffer Type */
27038  /* SPI Clock mode */
27040  /* SPI Input Sample Phase Selection */
27041  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
27042  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
27043  INT_SOURCE txInterruptSource ;
27044  /* Receive Interrupt Source for SPI module */
27045  INT_SOURCE rxInterruptSource ;
27046  /* Error Interrupt Source for SPI module */
27047  INT_SOURCE errInterruptSource ;
27048  /* While using standard buffer and polled mode how many transfers to do
27049  before yielding to other tasks*/
27050  uint8_t numTrfsSmPolled ;
27051  /* Dummy byte value which will be used for dummy transmission */
27052  uint32_t dummyByteValue ;
27053  /* This is the buffer queue size. This is the maximum
27054  number of transfer requests that driver will queue. */
27055  uint8_t queueSize ;
27056  /* This controls the minimum number of jobs that the driver will be able
27057  to accept without running out of memory. The driver will reserve this
27058  number of jobs from the global SPI queue so that it will always be available*/
27059  uint8_t jobQueueReserveSize ;
27060  /* This callback is fired when an operation is about to start on the
27061  SPI bus. This allows the user to set any pins that need to be set.
27062  This callback may be called from an ISR so should not include OSAL
27063  calls. The context parameter is the same one passed into the
27064  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27065  */
27067  /* This callback is fired when an operation has just completed on the
27068  SPI bus. This allows the user to set any pins that need to be set.
27069  This callback may be called from an ISR so should not include OSAL
27070  calls. The context parameter is the same one passed into the
27071  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27072  */
27074 } DRV_SPI_INIT ;
27075 // *****************************************************************************
27076 /* SPI Driver Client Specific Configuration
27077  Summary:
27078  Defines the data that can be changed per client.
27079  Description:
27080  This data type defines the data can be configured per client. This data can
27081  be per client, and overrides the configuration data contained inside of
27082  DRV_SPI_INIT.
27083  Remarks:
27084  None.
27085 */
27086 
27087 typedef
27088 struct _DRV_SPI_CLIENT_DATA
27089 {
27090  /* Baud Rate Value */
27091  uint32_t baudRate ;
27092  /* This callback is fired when an operation is about to start on the
27093  SPI bus. This allows the user to set any pins that need to be set.
27094  This callback may be called from an ISR so should not include OSAL
27095  calls. The context parameter is the same one passed into the
27096  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27097  */
27099  /* This callback is fired when an operation has just completed on the
27100  SPI bus. This allows the user to set any pins that need to be set.
27101  This callback may be called from an ISR so should not include OSAL
27102  calls. The context parameter is the same one passed into the
27103  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27104  */
27107 //DOM-IGNORE-BEGIN
27108 //DOM-IGNORE-END
27109  // #ifndef _DRV_SPI_DEFINITIONS_H
27110 /*******************************************************************************
27111  End of File
27112 */
27113 
27114 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
27115 /* CLOSE_FILE Include File */
27116 
27117 // DOM-IGNORE-BEGIN
27118 // DOM-IGNORE-END
27119 // *****************************************************************************
27120 // *****************************************************************************
27121 // Section: Interface Routines - System Level
27122 // *****************************************************************************
27123 // *****************************************************************************
27124 // *****************************************************************************
27125 /* Function:
27126  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
27127  const SYS_MODULE_INIT * const init )
27128  Summary:
27129  Initializes the SPI instance for the specified driver index.
27130  <p><b>Implementation:</b> Static/Dynamic</p>
27131  Description:
27132  This routine initializes the SPI driver instance for the specified driver
27133  index, making it ready for clients to open and use it. The initialization
27134  data is specified by the 'init' parameter. The initialization may fail if the
27135  number of driver objects allocated are insufficient or if the specified
27136  driver instance is already initialized. The driver instance index is
27137  independent of the SPI module ID. For example, driver instance 0 can be
27138  assigned to SPI2. If the driver is built statically, then some of the
27139  initialization parameters are overridden by configuration macros. Refer to
27140  the description of the DRV_SPI_INIT data structure for more details on
27141  which members on this data structure are overridden.
27142  Precondition:
27143  None.
27144  Parameters:
27145  index - Identifier for the instance to be initialized. Please note this
27146  is not the SPI id. The hardware SPI id is set in the initialization
27147  structure. This is the index of the driver index to use.
27148  init - Pointer to a data structure containing any data necessary to
27149  initialize the driver. If this pointer is NULL, the driver
27150  uses the static initialization override macros for each
27151  member of the initialization data structure.
27152  Returns:
27153  - If successful - returns a valid handle to a driver instance object
27154  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
27155  Example:
27156  <code>
27157  DRV_SPI_INIT init;
27158  SYS_MODULE_OBJ objectHandle;
27159  // Populate the SPI initialization structure
27160  init.spiId = SPI_ID_1,
27161  init.taskMode = DRV_SPI_TASK_MODE_ISR,
27162  init.spiMode = DRV_SPI_MODE_MASTER,
27163  init.allowIdleRun = false,
27164  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
27165  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
27166  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
27167  init.spiClk = CLK_BUS_PERIPHERAL_2,
27168  init.baudRate = 10000000,
27169  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
27170  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
27171  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
27172  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
27173  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
27174  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
27175  init.dummyByteValue = 0xFF,
27176  init.queueSize = 10,
27177  init.jobQueueReserveSize = 1,
27178  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
27179  if (SYS_MODULE_OBJ_INVALID == objectHandle)
27180  {
27181  // Handle error
27182  }
27183  </code>
27184  Remarks:
27185  This routine must be called before any other SPI routine is called.
27186  This routine should only be called once during system initialization
27187  unless DRV_SPI_Deinitialize is called to deinitialize the driver
27188  instance. This routine will NEVER block for hardware access.
27189 */
27190 
27191 SYS_MODULE_OBJ
27193  const SYS_MODULE_INDEX index ,
27194  const SYS_MODULE_INIT * const init ) ;
27195 //*************************************************************************
27196 /* Function:
27197  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
27198  Summary:
27199  Deinitializes the specified instance of the SPI driver module.
27200  <p><b>Implementation:</b> Static/Dynamic</p>
27201  Description:
27202  Deinitializes the specified instance of the SPI driver module,
27203  disabling its operation (and any hardware) and invalidates all of the
27204  internal data.
27205  Precondition:
27206  Function DRV_SPI_Initialize must have been called before calling this
27207  routine and a valid SYS_MODULE_OBJ must have been returned.
27208  Parameters:
27209  object - Driver object handle, returned from DRV_SPI_Initialize
27210  Returns:
27211  None.
27212  Example:
27213  <code>
27214  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27215  SYS_STATUS status;
27216  DRV_SPI_Deinitialize ( object );
27217  status = DRV_SPI_Status( object );
27218  if( SYS_MODULE_UNINITIALIZED == status )
27219  {
27220  // Check again later if you need to know
27221  // when the driver is deinitialized.
27222  }
27223  </code>
27224  Remarks:
27225  Once the Initialize operation has been called, the De-initialize
27226  operation must be called before the Initialize operation can be called
27227  again.
27228  This function will NEVER block waiting for hardware. If the operation
27229  requires time to allow the hardware to complete, this will be reported
27230  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
27231  to find out when the module is in the ready state.
27232 */
27233 
27234 void
27236  SYS_MODULE_OBJ object ) ;
27237 //**************************************************************************
27238 /* Function:
27239  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
27240  Summary:
27241  Provides the current status of the SPI driver module.
27242  <p><b>Implementation:</b> Static/Dynamic</p>
27243  Description:
27244  This function provides the current status of the SPI driver module.
27245  Precondition:
27246  The DRV_SPI_Initialize function must have been called before calling
27247  this function.
27248  Parameters:
27249  object - Driver object handle, returned from DRV_SPI_Initialize
27250  Returns:
27251  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
27252  system level operation and cannot start another
27253  Example:
27254  <code>
27255  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27256  SYS_STATUS status;
27257  status = DRV_SPI_Status( object );
27258  if( SYS_STATUS_READY != status )
27259  {
27260  // Handle error
27261  }
27262  </code>
27263  Remarks:
27264  Any value greater than SYS_STATUS_READY is also a normal running state
27265  in which the driver is ready to accept new operations.
27266  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
27267  deinitialized
27268  This value is less than SYS_STATUS_ERROR.
27269  This function can be used to determine when any of the driver's module
27270  level operations has completed.
27271  If the status operation returns SYS_STATUS_BUSY, the previous operation
27272  has not yet completed. Once the status operation returns
27273  SYS_STATUS_READY, any previous operations have completed.
27274  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
27275  that is also an error state.
27276  This function will NEVER block waiting for hardware.
27277  If the Status operation returns an error value, the error may be
27278  cleared by calling the reinitialize operation. If that fails, the
27279  deinitialize operation will need to be called, followed by the
27280  initialize operation to return to normal operations.
27281 */
27282 
27283 SYS_STATUS
27284  DRV_SPI_Status (
27285  SYS_MODULE_OBJ object ) ;
27286 // *****************************************************************************
27287 /* Function:
27288  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
27289  Summary:
27290  Maintains the driver's state machine and implements its ISR.
27291  <p><b>Implementation:</b> Static/Dynamic</p>
27292  Description:
27293  This routine is used to maintain the driver's internal state
27294  machine and implement its transmit ISR for interrupt-driven implementations.
27295  In polling mode, this function should be called from the SYS_Tasks()
27296  function. In interrupt mode, this function should be called in the transmit
27297  interrupt service routine of the USART that is associated with this USART
27298  driver hardware instance.
27299  Precondition:
27300  The DRV_SPI_Initialize routine must have been called for the specified
27301  SPI driver instance.
27302  Parameters:
27303  object - Object handle for the specified driver instance (returned from
27304  DRV_SPI_Initialize)
27305  Returns:
27306  None.
27307  Example:
27308  <code>
27309  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27310  while( true )
27311  {
27312  DRV_SPI_Tasks ( object );
27313  // Do other tasks
27314  }
27315  </code>
27316  Remarks:
27317  This function is normally not called directly by an application. It is
27318  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
27319  ISR.
27320  This function may execute in an ISR context and will never block or access any
27321  resources that may cause it to block.
27322 */
27323 
27324 void
27325  DRV_SPI_Tasks (
27326  SYS_MODULE_OBJ object ) ;
27327 // *****************************************************************************
27328 // *****************************************************************************
27329 // Section: Interface Routines - Client Level
27330 // *****************************************************************************
27331 // *****************************************************************************
27332 //**************************************************************************
27333 /* Function:
27334  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
27335  const DRV_IO_INTENT ioIntent )
27336  Summary:
27337  Opens the specified SPI driver instance and returns a handle to it.
27338  <p><b>Implementation:</b> Static/Dynamic</p>
27339  Description:
27340  This routine opens the specified SPI driver instance and provides a
27341  handle that must be provided to all other client-level operations to
27342  identify the caller and the instance of the driver. The ioIntent
27343  parameter defines how the client interacts with this driver instance.
27344  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
27345  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
27346  able to write to the driver. If the ioIntent in
27347  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
27348  write.
27349  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
27350  exclusive access to this client. The driver cannot be opened by any
27351  other client.
27352  Precondition:
27353  The DRV_SPI_Initialize function must have been called before calling
27354  this function.
27355  Parameters:
27356  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
27357  Please note this is not the SPI ID.
27358  ioIntent - Zero or more of the values from the enumeration
27359  DRV_IO_INTENT ORed together to indicate the intended use of
27360  the driver
27361  Returns:
27362  If successful, the routine returns a valid open-instance handle (a
27363  number identifying both the caller and the module instance).
27364  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
27365  can occur when the following is true:
27366  * if the number of client objects allocated via
27367  DRV_SPI_INSTANCES_NUMBER is insufficient
27368  * if the client is trying to open the driver but driver has been
27369  opened exclusively by another client
27370  * if the driver hardware instance being opened is not initialized or
27371  is invalid
27372  Example:
27373  <code>
27374  DRV_HANDLE handle;
27375  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
27376  if( DRV_HANDLE_INVALID == handle )
27377  {
27378  // Unable to open the driver
27379  }
27380  </code>
27381  Remarks:
27382  The handle returned is valid until the DRV_SPI_Close routine is
27383  called. This routine will NEVER block waiting for hardware. If the
27384  requested intent flags are not supported, the routine will return
27385  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
27386  It should not be called in an ISR.
27387 */
27388 
27389 DRV_HANDLE
27390  DRV_SPI_Open (
27391  const SYS_MODULE_INDEX drvIndex ,
27392  const DRV_IO_INTENT ioIntent ) ;
27393 //**************************************************************************
27394 /* Function:
27395  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
27396  const DRV_SPI_CLIENT_DATA * cfgData )
27397  Summary:
27398  Configures a SPI client with specific data.
27399  <p><b>Implementation:</b> Static/Dynamic</p>
27400  Description:
27401  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
27402  Whenever a new SPI job is started these values will be used. Passing in NULL will
27403  reset the client back to configuration parameters passed to driver initialization.
27404  A zero in any of the structure elements will reset that specific configuration back
27405  to the driver default.
27406  Precondition:
27407  The DRV_SPI_Open function must have been called before calling
27408  this function.
27409  Parameters:
27410  handle - handle of the client returned by DRV_SPI_Open.
27411  cfgData - Client-specific configuration data.
27412  Returns:
27413  - If successful - the routing will return greater than or equal to zero
27414  - If an error occurs - the return value is negative
27415 */
27416 
27417 int32_t
27419  DRV_HANDLE handle ,
27420  const DRV_SPI_CLIENT_DATA * cfgData ) ;
27421 // *****************************************************************************
27422 /* Function:
27423  void DRV_SPI_Close ( DRV_HANDLE handle )
27424  Summary:
27425  Closes an opened instance of the SPI driver.
27426  <p><b>Implementation:</b> Static/Dynamic</p>
27427  Description:
27428  This function closes an opened instance of the SPI driver, invalidating the
27429  handle.
27430  Precondition:
27431  The DRV_SPI_Initialize routine must have been called for the specified
27432  SPI driver instance.
27433  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27434  Parameters:
27435  handle - A valid open-instance handle, returned from the driver's
27436  open routine
27437  Returns:
27438  None.
27439  Example:
27440  <code>
27441  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27442  DRV_SPI_Close ( handle );
27443  </code>
27444  Remarks:
27445  After calling this routine, the handle passed in "handle" must not be used
27446  with any of the remaining driver routines. A new handle must be obtained by
27447  calling DRV_SPI_Open before the caller may use the driver again. This
27448  function is thread safe in a RTOS application.
27449  Note:
27450  Usually there is no need for the driver client to verify that the Close
27451  operation has completed.
27452 */
27453 
27454 void
27455  DRV_SPI_Close (
27456  DRV_HANDLE handle ) ;
27457 // *****************************************************************************
27458 // *****************************************************************************
27459 // Section: Interface Routines - Client level Read & Write APIs
27460 // *****************************************************************************
27461 // *****************************************************************************
27462 /* These are non-blocking APIs. It doesn't wait until the operation gets
27463  finished. The actual operation will happen it the task routine. The status of
27464  this operation can be monitored using DRV_SPI_BufferStatus function. In
27465  polling mode, User must ensure that the code gets time to execute the task
27466  routine. */
27467 //*******************************************************************************
27468 /* Function:
27469  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
27470  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27471  void * context )
27472  Summary:
27473  Registers a buffer for a read operation. Actual transfer will happen in
27474  the Task function.
27475  <p><b>Implementation:</b> Static/Dynamic</p>
27476  Description:
27477  Registers a buffer for a read operation. Actual transfer will happen in
27478  the Task function. The status of this operation can be monitored using
27479  DRV_SPI_BufferStatus function. A optional callback can also be
27480  provided that will be called when the operation is complete.
27481  Precondition:
27482  The DRV_SPI_Initialize routine must have been called for the specified
27483  SPI driver instance.
27484  DRV_SPI_Open must have been called to obtain a valid opened device
27485  handle.
27486  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27487  in the DRV_SPI_Open call.
27488  Parameters:
27489  handle - A valid open-instance handle, returned from the driver's
27490  open routine
27491  rxBuffer - The buffer to which the data should be written to.
27492  size - Number of bytes to be read from the SPI bus.
27493  completeCB - Pointer to a function to be called when this queued operation is complete.
27494  context - unused by the driver but this is passed to the callback when it is called.
27495  Returns:
27496  If the buffer add request is successful, a valid buffer handle is returned.
27497  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27498  Example:
27499  <code>
27500  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27501  char myBuffer[MY_BUFFER_SIZE], state = 0;
27502  DRV_SPI_BUFFER_HANDLE bufferHandle;
27503  switch ( state )
27504  {
27505  case 0:
27506  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
27507  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27508  {
27509  state++;
27510  }
27511  break;
27512  case 1:
27513  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27514  {
27515  state++;
27516  // All transmitter data has been sent successfully.
27517  }
27518  break;
27519  }
27520  </code>
27521  Remarks:
27522  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
27523  instead of it.
27524  */
27525 
27528  DRV_HANDLE handle ,
27529  void * rxBuffer ,
27530  size_t size ,
27531  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27532  void * context ) ;
27533 //*******************************************************************************
27534 /* Function:
27535  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
27536  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27537  void * context )
27538  Summary:
27539  Registers a buffer for a write operation. Actual transfer will happen
27540  in the Task function.
27541  <p><b>Implementation:</b> Static/Dynamic</p>
27542  Description:
27543  Registers a buffer for a write operation. Actual transfer will happen
27544  in the Task function. The status of this operation can be monitored
27545  using DRV_SPI_BufferStatus function. A optional callback can also be
27546  provided that will be called when the operation is complete.
27547  Precondition:
27548  The DRV_SPI_Initialize routine must have been called for the specified
27549  SPI driver instance.
27550  DRV_SPI_Open must have been called to obtain a valid opened device
27551  handle.
27552  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27553  in the DRV_SPI_Open call.
27554  Parameters:
27555  handle - A valid open-instance handle, returned from the driver's
27556  open routine
27557  txBuffer - The buffer which hold the data.
27558  size - Number of bytes to be written to the SPI bus.
27559  completeCB - Pointer to a function to be called when this queued operation is complete
27560  context - unused by the driver but this is passed to the callback when it is called
27561  Returns:
27562  If the buffer add request is successful, a valid buffer handle is returned.
27563  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27564  Example:
27565  <code>
27566  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27567  char myBuffer[MY_BUFFER_SIZE], state = 0;
27568  DRV_SPI_BUFFER_HANDLE bufferHandle;
27569  switch ( state )
27570  {
27571  case 0:
27572  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27573  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27574  {
27575  state++;
27576  }
27577  break;
27578  case 1:
27579  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27580  {
27581  state++;
27582  // All transmitter data has been sent successfully.
27583  }
27584  break;
27585  }
27586  </code>
27587  Remarks:
27588  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27589  instead of it.
27590 */
27591 
27594  DRV_HANDLE handle ,
27595  void * txBuffer ,
27596  size_t size ,
27597  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27598  void * context ) ;
27599 //*******************************************************************************
27600 /* Function:
27601  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27602  void *txBuffer, void *rxBuffer, size_t size, )
27603  Summary:
27604  Registers a buffer for a read and write operation. Actual transfer will
27605  happen in the Task function.
27606  <p><b>Implementation:</b> Static/Dynamic</p>
27607  Description:
27608  Registers a buffer for a read and write operation. Actual transfer will
27609  happen in the Task function. The status of this operation can be
27610  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27611  provided that will be called when the operation is complete.
27612  Precondition:
27613  The DRV_SPI_Initialize routine must have been called for the specified
27614  SPI driver instance.
27615  DRV_SPI_Open must have been called to obtain a valid opened device
27616  handle.
27617  Parameters:
27618  handle - A valid open-instance handle, returned from the driver's
27619  open routine
27620  txBuffer - The buffer which hold the data.
27621  txSize - Number of bytes to be written to the SPI bus.
27622  rxBuffer - The buffer to which the data should be written to.
27623  rxSize - Number of bytes to be read from the SPI bus
27624  completeCB - Pointer to a function to be called when this queued operation is complete
27625  context - unused by the driver but this is passed to the callback when it is called
27626  Returns:
27627  If the buffer add request is successful, a valid buffer handle is returned.
27628  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27629  Example:
27630  <code>
27631  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27632  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27633  DRV_SPI_BUFFER_HANDLE bufferHandle;
27634  switch ( state )
27635  {
27636  case 0:
27637  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27638  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27639  {
27640  state++;
27641  }
27642  break;
27643  case 1:
27644  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27645  {
27646  state++;
27647  // All transmitter data has been sent successfully.
27648  }
27649  break;
27650  }
27651  </code>
27652  Remarks:
27653  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27654  instead of it.
27655 */
27656 
27659  DRV_HANDLE handle ,
27660  void * txBuffer ,
27661  size_t txSize ,
27662  void * rxBuffer ,
27663  size_t rxSize ,
27664  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27665  void * context ) ;
27666 //*******************************************************************************
27667 /* Function:
27668  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27669  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27670  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27671  Summary:
27672  Registers a buffer for a read operation. Actual transfer will happen in
27673  the Task function.
27674  <p><b>Implementation:</b> Static/Dynamic</p>
27675  Description:
27676  Registers a buffer for a read operation. Actual transfer will happen in
27677  the Task function. The status of this operation can be monitored using
27678  DRV_SPI_BufferStatus function. A optional callback can also be
27679  provided that will be called when the operation is complete.
27680  Precondition:
27681  The DRV_SPI_Initialize routine must have been called for the specified
27682  SPI driver instance.
27683  DRV_SPI_Open must have been called to obtain a valid opened device
27684  handle.
27685  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27686  in the DRV_SPI_Open call.
27687  Parameters:
27688  handle - A valid open-instance handle, returned from the driver's
27689  open routine
27690  rxBuffer - The buffer to which the data should be written to.
27691  size - Number of bytes to be read from the SPI bus.
27692  completeCB - Pointer to a function to be called when this queued operation is complete
27693  context - unused by the driver but this is passed to the callback when it is called
27694  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27695  Returns:
27696  If the buffer add request is successful, a valid buffer handle is returned.
27697  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27698  Example:
27699  <code>
27700  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27701  char myBuffer[MY_BUFFER_SIZE], state = 0;
27702  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27703  switch ( state )
27704  {
27705  case 0:
27706  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27707  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27708  {
27709  state++;
27710  }
27711  break;
27712  case 1:
27713  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27714  {
27715  state++;
27716  // All transmitter data has been sent successfully.
27717  }
27718  break;
27719  }
27720  </code>
27721  Remarks:
27722  None.
27723  */
27724 
27727  DRV_HANDLE handle ,
27728  void * rxBuffer ,
27729  size_t size ,
27730  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27731  void * context ,
27732  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27733 //*******************************************************************************
27734 /* Function:
27735  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27736  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27737  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27738  Summary:
27739  Registers a buffer for a write operation. Actual transfer will happen
27740  in the Task function.
27741  <p><b>Implementation:</b> Static/Dynamic</p>
27742  Description:
27743  Registers a buffer for a write operation. Actual transfer will happen
27744  in the Task function. The status of this operation can be monitored
27745  using DRV_SPI_BufferStatus function. A optional callback can also be
27746  provided that will be called when the operation is complete.
27747  Precondition:
27748  The DRV_SPI_Initialize routine must have been called for the specified
27749  SPI driver instance.
27750  DRV_SPI_Open must have been called to obtain a valid opened device
27751  handle.
27752  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27753  in the DRV_SPI_Open call.
27754  Parameters:
27755  handle - A valid open-instance handle, returned from the driver's
27756  open routine
27757  txBuffer - The buffer which hold the data.
27758  size - Number of bytes to be written to the SPI bus.
27759  completeCB - Pointer to a function to be called when this queued operation is complete
27760  context - unused by the driver but this is passed to the callback when it is called
27761  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27762  Returns:
27763  If the buffer add request is successful, a valid buffer handle is returned.
27764  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27765  Example:
27766  <code>
27767  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27768  char myBuffer[MY_BUFFER_SIZE], state = 0;
27769  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27770  switch ( state )
27771  {
27772  case 0:
27773  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27774  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27775  {
27776  state++;
27777  }
27778  break;
27779  case 1:
27780  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27781  {
27782  state++;
27783  // All transmitter data has been sent successfully.
27784  }
27785  break;
27786  }
27787  </code>
27788  Remarks:
27789  None.
27790 */
27791 
27794  DRV_HANDLE handle ,
27795  void * txBuffer ,
27796  size_t size ,
27797  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27798  void * context ,
27799  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27800 //*******************************************************************************
27801 /* Function:
27802  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27803  void *txBuffer, void *rxBuffer, size_t size,
27804  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27805  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27806  Summary:
27807  Registers a buffer for a read and write operation. Actual transfer will
27808  happen in the Task function.
27809  <p><b>Implementation:</b> Static/Dynamic</p>
27810  Description:
27811  Registers a buffer for a read and write operation. Actual transfer will
27812  happen in the Task function. The status of this operation can be
27813  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27814  provided that will be called when the operation is complete.
27815  Precondition:
27816  The DRV_SPI_Initialize routine must have been called for the specified
27817  SPI driver instance.
27818  DRV_SPI_Open must have been called to obtain a valid opened device
27819  handle.
27820  Parameters:
27821  handle - A valid open-instance handle, returned from the driver's
27822  open routine
27823  txBuffer - The buffer which hold the data.
27824  txSize - Number of bytes to be written to the SPI bus.
27825  rxBuffer - The buffer to which the data should be written to.
27826  rxSize - Number of bytes to be read from the SPI bus
27827  completeCB - Pointer to a function to be called when this queued operation is complete
27828  context - unused by the driver but this is passed to the callback when it is called
27829  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27830  Returns:
27831  If the buffer add request is successful, a valid buffer handle is returned.
27832  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27833  Example:
27834  <code>
27835  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27836  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27837  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27838  switch ( state )
27839  {
27840  case 0:
27841  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27842  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27843  {
27844  state++;
27845  }
27846  break;
27847  case 1:
27848  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27849  {
27850  state++;
27851  // All transmitter data has been sent successfully.
27852  }
27853  break;
27854  }
27855  </code>
27856  Remarks:
27857  None.
27858 */
27859 
27862  DRV_HANDLE handle ,
27863  void * txBuffer ,
27864  size_t txSize ,
27865  void * rxBuffer ,
27866  size_t rxSize ,
27867  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27868  void * context ,
27869  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27870 // *****************************************************************************
27871 /* Function:
27872  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27873  Summary:
27874  Returns the transmitter and receiver transfer status.
27875  <p><b>Implementation:</b> Static/Dynamic</p>
27876  Description:
27877  This returns the transmitter and receiver transfer status.
27878  Precondition:
27879  The DRV_SPI_Initialize routine must have been called for the specified
27880  SPI driver instance.
27881  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27882  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27883  the buffer handle associated with that transfer.
27884  Parameters:
27885  bufferHandle - A valid buffer handle, returned from the driver's
27886  data transfer routine
27887  Returns:
27888  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27889  transfer.
27890  Example:
27891  <code>
27892  // Buffer handle returned from the data transfer function
27893  DRV_SPI_BUFFER_HANDLE bufferHandle;
27894  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27895  {
27896  // All transmitter data has been sent.
27897  }
27898  </code>
27899  Remarks:
27900  The returned status may contain a value with more than one of the bits
27901  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27902  should perform an AND with the bit of interest and verify if the
27903  result is non-zero (as shown in the example) to verify the desired status
27904  bit.
27905 */
27906 
27909  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27910 // *****************************************************************************
27911 /* Function:
27912  bool DRV_SPIn_ReceiverBufferIsFull(void)
27913  Summary:
27914  Returns the receive buffer status. 'n' represents the instance of the
27915  SPI driver used.
27916  <p><b>Implementation:</b> Static</p>
27917  Description:
27918  This function returns the receive buffer status (full/empty).
27919  Precondition:
27920  None.
27921  Parameters:
27922  None.
27923  Returns:
27924  Receive Buffer Status
27925  - 1 - Full
27926  - 0 - Empty
27927  Example:
27928  <code>
27929  bool rxBufStat;
27930  // Using instance 1 of SPI driver, that is n = 1
27931  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27932  if (rxBufStat)
27933  {
27934  ...
27935  }
27936  </code>
27937  Remarks:
27938  None.
27939 */
27940 
27941 bool
27943 // *****************************************************************************
27944 /* Function:
27945  bool DRV_SPIn_TransmitterBufferIsFull(void)
27946  Summary:
27947  Returns the transmit buffer status. 'n' represents the instance of the
27948  SPI driver used.
27949  <p><b>Implementation:</b> Static</p>
27950  Description:
27951  This function returns the transmit buffer status (full/empty).
27952  Precondition:
27953  None.
27954  Parameters:
27955  None.
27956  Returns:
27957  Transmit Buffer Status
27958  - 1 - Full
27959  - 0 - Empty
27960  Example:
27961  <code>
27962  bool txBufStat;
27963  // Using instance 1 of SPI driver, that is n = 1
27964  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27965  if (txBufStat)
27966  {
27967  ...
27968  }
27969  </code>
27970  Remarks:
27971  None.
27972 */
27973 
27974 bool
27976 //DOM-IGNORE-BEGIN
27977 //DOM-IGNORE-END
27978  // #ifndef _DRV_SPI_H
27979 /*******************************************************************************
27980  End of File
27981 */
27982 
27983 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27984 /* CLOSE_FILE Include File */
27985 
27986 #include "driver/usb/usbhs/drv_usbhs.h"
27987 #include "usb/usb_device.h"
27988 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27989 /**************************************************************************************/
27990 /* LDRA_INSPECTED 110 S
27991 */
28007 /**************************************************************************************/
28008 #ifndef APP_H /* Guard against multiple inclusion.*/
28009 #define APP_H
28010 /**************************************************************************************/
28011 /* ************************************************************************************/
28012 /* Section: Included Files */
28013 /**************************************************************************************/
28014 /**************************************************************************************/
28015 #include <stdint.h>
28016 /**************************************************************************************/
28017 /**************************************************************************************/
28018 /* Section: Data Types */
28019 /**************************************************************************************/
28020 /**************************************************************************************/
28021 /**************************************************************************************/
28022 /* APP_DATA
28023  Summary:
28024  Holds APP_DATA used for the APP tasks.
28025  Description:
28026  Holds APP_DATA used for the APP tasks. The variables
28027  used are stored here.
28028  Remarks:
28029  None
28030  */
28031 
28032 typedef
28033  struct
28034  {
28035  uint8_t RevNumber ;
28036  } APP_DATA ;
28037 
28038 extern APP_DATA
28039  APP ;
28040 /**************************************************************************************/
28041 /**************************************************************************************/
28042 /* Section: Application Initialization and State Machine Functions */
28043 /**************************************************************************************/
28044 /**************************************************************************************/
28045 /*!*************************************************************************************
28046  Function:
28047  void APP_Initialize(void)
28048  Summary:
28049  Autonomous tool application initialization routine.
28050  Description:
28051  This function initializes the application. It places the
28052  application in its initial state and prepares it to run so that its
28053  APP_Tasks function can be called.
28054  Precondition:
28055  All other system initialization routines should be called before calling
28056  this routine (in "SYS_Initialize").
28057  Parameters:
28058  None.
28059  Returns:
28060  None.
28061  Example:
28062  APP_Initialize()
28063  Remarks:
28064  This routine must be called from the main function.
28065 */
28066 
28067 void
28068  APP_Initialize ( void ) ;
28069 /*!*************************************************************************************
28070  Function:
28071  void APP_Tasks(void)
28072  Summary:
28073  Application tasks function
28074  Description:
28075  This function is the main application's tasks function. It contains the various
28076  tasks that are maintained during the operation of the shooting panel.
28077  Precondition:
28078  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
28079  should be called before calling this.
28080  Parameters:
28081  None.
28082  Returns:
28083  None.
28084  Example:
28085  APP_Tasks()
28086  Remarks:
28087  This routine must be called from the main() routine.
28088  */
28089 
28090 void
28091  APP_Tasks ( void ) ;
28092  /* APP_H */
28093 /***************************************************************************************
28094  End of File
28095  */
28096 
28097 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
28098 /* CLOSE_FILE Include File */
28099 
28100 // DOM-IGNORE-BEGIN
28101 // DOM-IGNORE-END
28102 // *****************************************************************************
28103 // *****************************************************************************
28104 // Section: Type Definitions
28105 // *****************************************************************************
28106 // *****************************************************************************
28107 // *****************************************************************************
28108 /* System Objects
28109  Summary:
28110  Structure holding the system's object handles
28111  Description:
28112  This structure contains the object handles for all objects in the
28113  MPLAB Harmony project's system configuration.
28114  Remarks:
28115  These handles are returned from the "Initialize" functions for each module
28116  and must be passed into the "Tasks" function for each module.
28117 */
28118 
28119 typedef
28120  struct
28121  {
28122  SYS_MODULE_OBJ sysTmr ;
28123  SYS_MODULE_OBJ drvTmr0 ;
28124  SYS_MODULE_OBJ drvTmr1 ;
28125  SYS_MODULE_OBJ drvTmr2 ;
28126  SYS_MODULE_OBJ drvTmr3 ;
28127  SYS_MODULE_OBJ drvTmr4 ;
28128  SYS_MODULE_OBJ drvUsart0 ;
28129  SYS_MODULE_OBJ drvPMP0 ;
28130  /*** SPI Object for Index 0 ***/
28131  SYS_MODULE_OBJ spiObjectIdx0 ;
28132  /*** SPI Object for Index 1 ***/
28133  SYS_MODULE_OBJ spiObjectIdx1 ;
28134  /*** SPI Object for Index 2 ***/
28135  SYS_MODULE_OBJ spiObjectIdx2 ;
28136  SYS_MODULE_OBJ drvUSBObject ;
28137  SYS_MODULE_OBJ usbDevObject0 ;
28138  } SYSTEM_OBJECTS ;
28139 // *****************************************************************************
28140 // *****************************************************************************
28141 // Section: extern declarations
28142 // *****************************************************************************
28143 // *****************************************************************************
28144 
28145 extern SYSTEM_OBJECTS
28146  sysObj ;
28147 //DOM-IGNORE-BEGIN
28148 //DOM-IGNORE-END
28149  /* _SYS_DEFINITIONS_H */
28150 /*******************************************************************************
28151  End of File
28152 */
28153 
28154 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
28155 /* CLOSE_FILE Include File */
28156 
28157 /**************************************************************************************/
28158 /**************************************************************************************/
28159 /* Section: Data Types */
28160 /**************************************************************************************/
28161 /**************************************************************************************/
28162 
28163 typedef
28164 float
28166 /**************************************************************************************/
28167 /*FSK states
28168  Summary:
28169  FSK states enumeration
28170  Description:
28171  This enumeration defines the valid FSK states. These states
28172  determine the behavior of the FSK state machine at various times.
28173 */
28174 
28175 typedef
28176  enum
28177  {
28184  } FSK_STATES ;
28185 /**************************************************************************************/
28186 /* FSK_DATA
28187  Summary:
28188  Holds FSK_DATA used for the FSK tasks.
28189  Description:
28190  Holds FSK_DATA used for the FSK tasks. The state machine and variables
28191  used to control FSK functions are stored here.
28192  Remarks:
28193  None
28194  */
28195 
28196 typedef
28197  struct
28198  {
28199  FSK_STATES state ;
28200  uint8_t crc ;
28201  uint8_t null_count ;
28202  bool send_message_complete_flag ;
28203  bool tick ;
28204  float32_t baud ;
28205  float32_t fsk_timer_freq ;
28206  float32_t mark_count ;
28207  float32_t space_count ;
28208  float32_t TABLE_MOD [ 50 ] ;
28209  uint8_t table_count ;
28210  } FSK_DATA ;
28211 
28212 extern FSK_DATA
28213  FSK ;
28214  /**************************************************************************************/
28215 
28216 typedef
28217  union /* Union defining the PerfSwitch message component lengths.*/
28218  {
28219  uint32_t dword ;
28220  uint16_t word ;
28221  uint8_t byte [ 4 ] ;
28222  } TMultiValue ;
28223 
28224 extern TMultiValue
28225  MESSAGE ;
28226 /**************************************************************************************/
28227 /**************************************************************************************/
28228 /* DOWN_MSG Data
28229  Summary:
28230  Holds DOWN_MSG data used for the FSK tasks.
28231  Description:
28232  Holds DOWN_MSG data used for the FSK tasks. The variables used to control FSK
28233  message are stored here.
28234  Remarks:
28235  None
28236  */
28237 
28238 typedef
28239  struct /* Structure defining the components of the FSK message to a PerfSwitch.*/
28240  {
28241  uint8_t identifier ;
28242  uint8_t command ;
28243  uint8_t msg_length ;
28244  uint8_t xmit_ready_flag ;
28245  } DOWN_MSG ;
28246 
28247 extern DOWN_MSG
28248  DWNMSG ;
28249 /**************************************************************************************/
28250 /*MSG states
28251  Summary:
28252  MSG states enumeration
28253  Description:
28254  This enumeration defines the valid MSG states. These states
28255  determine the behavior of the MSG state machine at various times. This machine
28256  also controls access to the PRE_MSG state machine.
28257 */
28258 
28259 typedef
28260  enum
28261  {
28267  } MSG_STATES ;
28268 /**************************************************************************************/
28269 /* MSG_DATA
28270  Summary:
28271  Holds MSG_DATA used for the MSG tasks.
28272  Description:
28273  Holds MSG_DATA used for the MSG tasks. The state machine and variables
28274  used to control MSG functions are stored here.
28275  Remarks:
28276  None
28277  */
28278 
28279 typedef
28280  struct
28281  {
28282  MSG_STATES state ;
28283  uint32_t command ;
28284  uint8_t length ;
28285  } MSG_DATA ;
28286 
28287 extern MSG_DATA
28288  MSG ;
28289 /**************************************************************************************/
28290 /*PREAMBLE states
28291  Summary:
28292  PRE_MSG states enumeration
28293  Description:
28294  This enumeration defines the valid PREAMBLE states. These states
28295  determine the behavior of the PREAMBLE state machine at various times. This is
28296  accessed from the MSG_STATE machine.
28297 */
28298 
28299 typedef
28300  enum
28301  {
28308  } PREAMBLE_STATES ;
28309 /**************************************************************************************/
28310 /* PRE_DATA
28311  Summary:
28312  Holds PRE_MSG_DATA used for the PRE_MSG tasks.
28313  Description:
28314  Holds PRE_MSG_DATA used for the PRE_MSG tasks. The state machine and variables
28315  used to control PRE_MSG functions are stored here.
28316  Remarks:
28317  None
28318  */
28319 
28320 typedef
28321  struct
28322  {
28323  PREAMBLE_STATES state ;
28324  } PRE_DATA ;
28325 
28326 extern PRE_DATA
28327  PRE_MSG ;
28328 
28329 static const uint8_t
28330  Xmit11 [ 312 ] = /* Array for the FSK frequency generation for a 'Mark'.*/
28331  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
28332  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
28333  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
28334  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
28335  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
28336  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U
28337  , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U ,
28338  0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU
28339  , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU ,
28340  0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U
28341  , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
28342 
28343 static const uint8_t
28344  Xmit00 [ 168 ] = /* Array for the FSK frequency generation for a 'Space'.*/
28345  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
28346  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
28347  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
28348  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
28349  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
28350  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
28351 /**************************************************************************************/
28352 /**************************************************************************************/
28353 /* External Functions */
28354 /**************************************************************************************/
28355 /**************************************************************************************/
28356 /*!*************************************************************************************
28357  Function:
28358  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length )
28359  Summary:
28360  Receives information from the command parser and stores it into the DwnMsg (FSK)
28361  structure for transmission by FSK.
28362  Description:
28363  Receives information from the command parser and stores it into the DwnMsg (FSK)
28364  structure for transmission by FSK. No other action is performed on the data here.
28365  The DwnMsg (FSK) elements can be manipulated prior to the FSK transmission to
28366  create the final MESSAGE array for longer commands.
28367 
28368  Precondition:
28369  None.
28370  Parameters:
28371  uint8_t Identifier: The lower 3 bits of Frame 4 from the Protocol B command.
28372  uint8_t Cmd: Frame 0 from the Protocol B command.
28373  uint8_t msgLength: The FSK message length in bits.
28374  Returns
28375  None.
28376 
28377  Remarks
28378  None.
28379 
28380  Example:
28381  Prepare_Dwn_Msg(ident,cmd, 20)
28382  */
28383 
28384 void
28385  Prepare_Dwn_Msg (
28386  uint8_t Identifier ,
28387  uint8_t Cmd ,
28388  uint8_t Msg_Length ) ;
28389 /*!*************************************************************************************
28390  Function:
28391  void Generate_Sine_Wave_Data( float32_t NoOfTicks )
28392  Summary:
28393  This function stores sine wave inter step time values into two arrays at
28394  initialization and if the FSK frequency needs to be adjusted. These values
28395  represent the amount of time between updates of the sine wave data DAC used to
28396  generate a 1 or 0.
28397  Description:
28398  This function stores sine wave inter step time values into two arrays at
28399  initialization and if the FSK frequency needs to be adjusted. The TimeMark array
28400  is for the time between a 'MARK' update and the TimeSpace array is for the time
28401  between a 'SPACE' update. Changing the time between the updates will effectively
28402  change the transmitted frequency for a 'MARK' or 'SPACE'. This occurs if there
28403  are errors during the data transmission to a PerfSwitch. This can occur as the
28404  PerfSwitch gets hot when it is down hole.
28405 
28406  Precondition:
28407  None.
28408  Parameters:
28409  float32_t NoOfTicks: This is an error factor used to correct the inter step
28410  time values.
28411  Returns
28412  None.
28413 
28414  Remarks
28415  None.
28416 
28417  Example:
28418  void GenerateSineWaveData( float32_t NoOfTicks )
28419  */
28420 
28421 void
28423  float32_t NoOfTicks ) ;
28424 /**************************************************************************************/
28425 /**************************************************************************************/
28426 /* Local Functions */
28427 /**************************************************************************************/
28428 /**************************************************************************************/
28429 /*!*************************************************************************************
28430  Function:
28431  static void Init_FSK( void )
28432  Summary:
28433  Function to initialize the FSK parameters.
28434  Description:
28435  Function to initialize the FSK parameters. All of the flags and table data are
28436  set to their initial condition. Timer 2 is also started. It is set to 160nS and
28437  is used to count the time between the Manchester transitions.
28438 
28439  Precondition:
28440  None.
28441  Parameters:
28442  None.
28443  Returns:
28444  None.
28445 
28446  Remarks:
28447  None.
28448 
28449  Example:
28450  Init_FSK()
28451  */
28452 
28453 static void
28454  Init_FSK ( void ) ;
28455 /*!*************************************************************************************
28456  Function:
28457  static void Send_Space( void )
28458  Summary:
28459  This function sends a FSK 0 or 'SPACE'.
28460  Description:
28461  This function sends a FSK 0 or 'SPACE'. It is called from the SendMessage
28462  function. sendSpace reads the Xmit00 array and sends the data to the FSK DAC.
28463  The time between the updates is controlled by a timer matching the corresponding
28464  value of the TimeSpace array. An FSK 'zero' is approximately 2800 Hz with
28465  7 cycles lasting approximately 2.5 ms.
28466 
28467  Precondition:
28468  None.
28469  Parameters:
28470  None.
28471  Returns
28472  None.
28473 
28474  Remarks
28475  None.
28476 
28477  Example:
28478  SendSpace()
28479  */
28480 
28481 static void
28482  Send_Space ( void ) ;
28483 /*!*************************************************************************************
28484  Function:
28485  static void Send_Mark( void )
28486  Summary:
28487  This function sends a FSK 1 or 'MARK'.
28488  Description:
28489  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
28490  function. Send_Mark reads the Xmit11 array and sends the data to the FSK DAC.
28491  The time between the updates is controlled by a timer matching the corresponding
28492  value of the TimeMark array. An FSK 'one' is approximately 5200 Hz with
28493  13 cycles lasting approximately 2.5 ms.
28494 
28495  Precondition:
28496  None.
28497  Parameters:
28498  None.
28499  Returns
28500  None.
28501 
28502  Remarks
28503  None.
28504 
28505  Example:
28506  sendMark()
28507  */
28508 
28509 static void
28510  Send_Mark ( void ) ;
28511 /**************************************************************************************/
28512 /**************************************************************************************/
28513 /* State Machine Functions */
28514 /**************************************************************************************/
28515 /**************************************************************************************/
28516 /*!*************************************************************************************
28517  Function:
28518  void FSK_Tasks(void)
28519  Summary:
28520  FSK_Tasks function
28521  Description:
28522  This routine is the FSK_Tasks function. It defines the FSK_Tasks state
28523  machine and core logic. This machine is used to send an FSK message to a
28524  PerfSwitch. It checks to see if there is a message for Tx and decides if it is a
28525  short or a long message. For a long message, it calculates the CRC and appends
28526  it to the Message and calls Send_Message_Tasks. If a good Manchester response is
28527  received, it resets all flags and prepares to send another message. Otherwise,
28528  it prepares to resend the previous message at a corrected frequency.
28529 
28530  Precondition:
28531  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28532  should be called before calling this.
28533  Parameters:
28534  None.
28535  Returns:
28536  None.
28537  Remarks:
28538  This routine must be called from the APP_Tasks() routine.
28539  Example:
28540  FSK_Tasks()
28541  */
28542 
28543 void
28544  FSK_Tasks ( void ) ;
28545 /*!*************************************************************************************
28546  Function:
28547  static void Send_Message_Tasks(void)
28548  Summary:
28549  Send_Message_Tasks function
28550  Description:
28551  This routine is the Send_Message_Tasks function. It defines the Send_Message_Tasks
28552  state machine and core logic. This machine is used to send an FSK message to a
28553  PerfSwitch. It can control the MAnchester bias DAC. It then controls the PREAMBLE
28554  (PRE_MSG) state machine to send the preamble. Then the actual message is sent.
28555  Precondition:
28556  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28557  should be called before calling this.
28558  Parameters:
28559  None.
28560  Returns:
28561  None.
28562  Remarks:
28563  This routine must be called from the FSK_Tasks() routine.
28564  Example:
28565  Send_Message_Tasks()
28566  */
28567 
28568 static void
28569  Send_Message_Tasks ( void ) ;
28570  /* FSK_H */
28571 /***************************************************************************************
28572  End of File
28573  */
28574 
28575 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h*/
28576 /* CLOSE_FILE Include File */
28577 
28578 #include <stdint.h>
28579 /**************************************************************************************/
28580 /**************************************************************************************/
28581 /* Section: Defines */
28582 /**************************************************************************************/
28583 /**************************************************************************************/
28584 #define bitset( var , bitno ) ( ( var ) |= 1UL << ( bitno ) )
28585 #define bitclr( var , bitno ) ( ( var ) &= ~ ( 1UL << ( bitno ) ) )
28586 /**************************************************************************************/
28587 /**************************************************************************************/
28588 /* Section: Structure Data and Local Variables */
28589 /**************************************************************************************/
28590 /**************************************************************************************/
28591 /* Note use the qualifier of static after debugging*/
28592 
28593 static uint16_t
28595 /*!*************************************************************************************
28596  Function:
28597  void Set_Status( uint8_t bitposn )
28598  Summary:
28599  Function to set a desired bit position to a one in the SurfaceStatus register.
28600  Remarks:
28601  Refer to the statusst.h interface header for function usage details.
28602  */
28603 
28604 void
28606  uint8_t bitposn )
28607  {
28608  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28609  (
28610  ( PIB_Status ) |= 1UL << (
28611  ( bitposn - 1U ) ) ) ;
28612  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 30 */
28613  statusst_58zqendz ( 62 ) ; /* 30 */
28614  }
28615 /*!*************************************************************************************
28616  Function:
28617  void Clear_Status( uint8_t bitposn )
28618  Summary:
28619  Function to clear a desired bit position to a 0 in the SurfaceStatus register.
28620  Remarks:
28621  Refer to the statusst.h interface header for function usage details.
28622  */
28623 
28624 void
28626  uint8_t bitposn )
28627  {
28628  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 30))); /* 37 */
28629  (
28630  ( PIB_Status ) &= ~ ( 1UL << (
28631  ( bitposn - 1U ) ) ) ) ;
28632  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
28633  statusst_58zqendz ( 64 ) ; /* 30 */
28634  }
28635 /*!*************************************************************************************
28636  Function:
28637  void Prepare_Return_A( uint8_t byte, uint16_t data2, uint16_t data1 )
28638  Summary:
28639  Function to prepare the protocol A response.
28640  Remarks:
28641  Refer to the statusst.h interface header for function usage details.
28642  */
28643 
28644 void
28646  uint8_t byte ,
28647  uint16_t data2 ,
28648  uint16_t data1 )
28649  {
28650  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 0))); /* 37 */
28651  uint8_t
28652  a_temp [ 6 ] ;
28653  uint8_t
28654  a_comm_crc ;
28655  a_temp[ 0 ] = byte ; /* Put Command in Frame 0.*/
28656  a_temp[ 1 ] = ( uint8_t ) (
28657  ( PIB_Status & 0xFF00U ) >> 8 ) ; /* Move upper 8 bits of SurfaceStatus into Frame 1 & */
28658  a_temp[ 2 ] = ( uint8_t ) ( PIB_Status & 0x00FFU ) ; /* move lower 8 bits of SurfaceStatus into Frame 2.*/
28659  a_temp[ 3 ] = ( uint8_t ) (
28660  ( data2 & 0x0FF0U ) >> 4 ) ; /* Move upper 8 bits of data2 into Frame 3.*/
28661  a_temp[ 4 ] = ( uint8_t ) (
28662  ( data2 & 0x000FU ) ) << 4 ; /* Move lower 4 bits of data2 into upper 4 bits of Frame 4.*/
28663  a_temp[ 4 ] = a_temp[ 4 ] | ( uint8_t ) (
28664  ( data1 & 0x0F00U ) >> 8 ) ; /* Move upper four bits of data1 into lower four bits of Frame 4.*/
28665  a_temp[ 5 ] = ( uint8_t ) ( data1 & 0x00FFU ) ;/* Move lower 8 bits of data1 into 8 bits of Frame 5.*/
28666  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 0 ] ) ;/* Transfer array elements into TxFifo.*/
28667  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 1 ] ) ;
28668  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 2 ] ) ;
28669  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 3 ] ) ;
28670  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 4 ] ) ;
28671  ( void ) Fifo_Put ( & TX_FIFO , a_temp[ 5 ] ) ;
28672  /* LDRA_INSPECTED 91 D
28673 */
28674  a_comm_crc = Calc_CRC_Array ( 6 , a_temp ) ; /* Calculate the CRC of the array.*/
28675  ( void ) Fifo_Put ( & TX_FIFO , a_comm_crc ) ;/* Put the CRC result into the last byte of the TxFifo.*/
28676  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 30 */
28677  statusst_58zqendz ( 66 ) ; /* 30 */
28678  }
28679 /*!*************************************************************************************
28680  Function:
28681  void Prepare_Return_B( uint8_t byt[ ] )
28682  Summary:
28683  Function to prepare the protocol B response.
28684  Remarks:
28685  Refer to the statusst.h interface header for function usage details.
28686  */
28687 
28688 void
28690  uint8_t byt [] )
28691  {
28692  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 2))); /* 37 */
28693  uint8_t
28694  b_temp [ 6 ] ;
28695  uint8_t
28696  b_comm_crc ;
28697  b_temp[ 0 ] = DWNMSG.command ;/* Put Command in Frame 0.*/
28698  b_temp[ 1 ] = ( uint8_t ) ( PIB_Status >> 8 ) ;/* Move upper 8 bits of SurfaceStatus into Frame 1 & */
28699  b_temp[ 2 ] = ( uint8_t ) PIB_Status ; /* Move lower 8 bits of SurfaceStatus into Frame 2.*/
28700  b_temp[ 3 ] = ( byt[ 0 ] & 0x07U ) << 5 ;
28701  /* Move upper 3 bits of Switch Status into position*/
28702  /* 7,6,5 of Frame 3.*/
28703  b_temp[ 3 ] = b_temp[ 3 ] | (
28704  ( byt[ 1 ] ) >> 3 ) ;
28705  /* Move next 5 bits of Switch Status into position*/
28706  /* 4,3,2,1,0 of Frame 3.*/
28707  b_temp[ 4 ] = ( byt[ 1 ] & 0x07U ) << 5 ;
28708  /* Move remaining 3 bits of Switch Status into*/
28709  /* position 7,6,5 of Frame 4. Bit 4 is not used.*/
28710  b_temp[ 4 ] = b_temp[ 4 ] | (
28711  ( byt[ 0 ] >> 4 ) & 0x07U ) ; /* Move 4 bit State ID into position 3,2,1,0 of Frame 4.a 3 bit field.*/
28712  b_temp[ 5 ] = byt[ 2 ] ;
28713  /* Move 8 bit Unit ID of data2 into 8 bits*/
28714  /* of Frame 5.*/
28715  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 0 ] ) ;/* Transfer array elements into TxFifo.*/
28716  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 1 ] ) ;
28717  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 2 ] ) ;
28718  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 3 ] ) ;
28719  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 4 ] ) ;
28720  ( void ) Fifo_Put ( & TX_FIFO , b_temp[ 5 ] ) ;
28721  b_comm_crc = Calc_CRC_Array ( 6 , b_temp ) ; /* Calculate the CRC of the array.*/
28722  ( void ) Fifo_Put ( & TX_FIFO , b_comm_crc ) ;/* Put the CRC result into the last byte of the TxFifo.*/
28723  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 30 */
28724  statusst_58zqendz ( 68 ) ; /* 30 */
28725  }
28726 /***************************************************************************************
28727  End of File
28728  */
28729 #define qqqbranches 68
28730 #define QQQMAXMCDCSIZE 2
28731 /********************** LDRA_PORT INSTRUMENTATION **********************/
28732 
28733 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
28734 #define ldra_sscanf
28735  /* put in undefs to protect our parameter names from macros */
28736 #undef f
28737 #undef i
28738 #undef j
28739 #undef k
28740 #undef s
28741 #undef l
28742 #undef ii
28743 #undef some
28744 #undef none
28745 #undef from
28746 #undef a
28747 #undef b
28748 #undef iz
28749 #undef jz
28750 #undef qqnull_params
28751 #define qqnull_params void
28752  /* Conventional Instrumentation */
28753 #define qqzzidfield 1
28754  /* single file or fileid */
28755  /* these have an extra field for the fileid */
28756  static char qqqqone[] = "%6d\n"; /* single point */
28757  /* uncompressed data structures */
28758  /* uncompressed bitmap */
28759 #define QQQFIXEDSIZE
28760  static int qqqlast = 0;
28761  extern int qqupload_registered;
28762  extern int statusst_58zqqzqz(qqnull_params);
28763  extern int statusst_58zqqzqz1(qqnull_params);
28764  /* ----------------------------------------------------------------------* 200 *
28765  * Procedures
28766  * -----------------------------------------------------------------------------
28767  */
28768  /* ----------- zscanf ---------------------------------------------------* 201 *
28769  * Returns an integer extracted from a string
28770  * -----------------------------------------------------------------------------
28771  */
28772  static int statusst_58zscanf(char * qqscan_str)
28773  {
28774  int qqvalue;
28775  int qqisign;
28776  char * qqcptr;
28777  qqvalue = 0;
28778  qqisign = 1;
28779  qqcptr = qqscan_str;
28780  /* Skip spaces */
28781  while (qqcptr[0] == ' ')
28782  {
28783  qqcptr++;
28784  }
28785  /* Check for a leading ---
28786  */
28787  if (qqcptr[0] == '-')
28788  {
28789  qqisign = -1;
28790  qqcptr++;
28791  }
28792  /* Extract digits */
28793  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
28794  {
28795  qqvalue = 10 * qqvalue;
28796  qqvalue = qqvalue + (qqcptr[0] - '0');
28797  qqcptr++;
28798  }
28799  qqvalue = qqisign * qqvalue;
28800  return qqvalue;
28801  } /* end of zscanf */
28802  /* ----------------------------------------------------------------------* 210 *
28803  * C System utilities in use:
28804  * fprintf
28805  * fclose
28806  * sscanf
28807  * -----------------------------------------------------------------------------
28808  */
28809  /* ----------------------------------------------------------------------* 213 *
28810  * qqoutput* suite
28811  * Main output routines. These may require modification.
28812  * -----------------------------------------------------------------------------
28813  */
28814  /* ----------------------------------------------------------------------* 214 *
28815  * qqoutput
28816  * This is the principle output routine.
28817  * -----------------------------------------------------------------------------
28818  */
28819  static void qqoutput(FILEPOINT char * s,int i)
28820  /* f - file pointer, s - format string, i - integer for probe value */
28821  {
28822  /* printing to a file */
28823  /* fprintf exists, not threaded */
28824  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
28825  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
28826  ldra_port_write (&ldra_buffer[0]);
28827  } /* end of qqoutput */
28828  /* ----------------------------------------------------------------------* 215 *
28829  * qqoutput0
28830  * -----------------------------------------------------------------------------
28831  */
28832  static void qqoutput0(FILEPOINT char * s)
28833  {
28834  ldra_port_write(s);
28835  } /* end of qqoutput0 */
28836  /* ----------------------------------------------------------------------* 216 *
28837  * qqoutput2
28838  * -----------------------------------------------------------------------------
28839  */
28840  static void qqoutput2(FILEPOINT char * s,int i, int j)
28841  {
28842  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
28843  ldra_port_write (&ldra_buffer[0]);
28844  } /* end of qqoutput2 */
28845  /* ----------------------------------------------------------------------* 217 *
28846  * qqoutput3
28847  * -----------------------------------------------------------------------------
28848  */
28849  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
28850  {
28851  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
28852  ldra_port_write (&ldra_buffer[0]);
28853  } /* end of qqoutput3 */
28854  /* ----------------------------------------------------------------------* 218 *
28855  * qqoutput4
28856  * -----------------------------------------------------------------------------
28857  */
28858  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
28859  {
28860  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
28861  ldra_port_write (&ldra_buffer[0]);
28862  } /* end of qqoutput4 */
28863  /* ----------------------------------------------------------------------* 219 *
28864  * end of qqoutput* suite
28865  * -----------------------------------------------------------------------------
28866  */
28867  /* ----------------------------------------------------------------------* 222 *
28868  * qqqqinitialise
28869  * This procedure initialises the structures for
28870  * compressed execution histories.
28871  * -----------------------------------------------------------------------------
28872  */
28873  static void qqqqinitialise(int ii)
28874  {
28875  unsigned int i;
28876  /* First time through. */
28877  /* bitmap */
28878  /* bitmap separate */
28879  qqqlast = 1; /* stops qqfun() calling initialise again */
28880  /* bitmap */
28881  /* bitmap singlefile */
28882  /* struct singlefile notmainfl */
28883  } /* end of qqqqinitialise */
28884 /* ----------------------------------------------------------------------* 225 *
28885 * qqqbitmapreset
28886 * This procedure resets the structures for
28887 * compressed execution histories.
28888 * -----------------------------------------------------------------------------
28889 */
28890 static void qqqbitmapreset()
28891 {
28892 struct bitmapstruct_t localbitmap = {0};
28893 bitmapstruct = localbitmap;
28894 } /* end of qqqbitmapreset */
28895 #undef QQQTEMP1
28896 #define QQQTEMP1
28897  /* ----------- zqqzqz ---------------------------------------------------* 310 *
28898  * -----------------------------------------------------------------------------
28899  */
28900  /* ----------------------------------------------------------------------* 312 *
28901  * This routine opens the execution history file. It is instrumented at the
28902  * start of the main program if one exists in the file. In general this is
28903  * superceded by statusst_58zqqzqz1 below.
28904  * -----------------------------------------------------------------------------
28905  */
28907  {
28908  if ( statusst_58zzopen != 1 )
28909  {
28910 #undef QQQMUSTOPEN
28911  statusst_58zzopen = 1;
28912  }
28913  return(1);
28914  } /* end of zqqzqz */
28915  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
28916  * -----------------------------------------------------------------------------
28917  */
28918  /* ----------------------------------------------------------------------* 317 *
28919  * This routine also opens the execution history file. It is called
28920  * automatically if a probe fires and the execution history is not already
28921  * opened (statusst_58zzopen = 0 ).
28922  * Because this always works ( it was intended for files with no main program
28923  * it is now the de facto common way to open the execution history.
28924  * -----------------------------------------------------------------------------
28925  */
28927  {
28928  if ( statusst_58zzopen != 1 )
28929  {
28930  ldra_port_open(); /* 7 */
28931  qqqqinitialise(0);
28932  statusst_58zzopen = 1;
28933  }
28934  return(1);
28935  } /* end of zqqzqz1 */
28936  /* ----------- zqendz ---------------------------------------------------* 330 *
28937  * This routine is called on exiting a routine in a
28938  * module. It closes the execution history.
28939  * -----------------------------------------------------------------------------
28940  */
28941 static int statusst_58zqendz(int qqqi)
28942  {
28943  if (!qqqstructzzopen)
28944  {
28946  qqqstructzzopen = 1;
28947  }
28948  if ( statusst_58zzopen != 1 )
28949  {
28950  statusst_58zqqzqz1();
28951  }
28952  /* ----------------------------------------------------------------------* 331 *
28953  * this is the one which puts an integer into
28954  * the execution history file and returns unity.
28955  * The format of each field consists of six columns,
28956  * the number is right justified in this field.
28957  * -----------------------------------------------------------------------------
28958  */
28959  if ( statusst_58zzopen )
28960  {
28961  /* uncompressed */
28962  /* uncompressed unbuffered */
28963  /* uncompressed unbuffered bitmap */
28964  if ( qqqi > 0 )
28965  {
28966  }
28967  else
28968  {
28969  }
28970  }
28971  qqqlast = 0;
28972  return(1);
28973  } /* end of zqendz */
28974  /* ----------------------------------------------------------------------* 335 *
28975  * Output structure - qqbmsoutput
28976  * -----------------------------------------------------------------------------
28977  */
28978  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
28979  {
28980  static int branches_printed = 0;
28981  int b, last = 0;
28982  for(b=0;b<qqqqbmselwidth/8;b++)
28983  {
28984  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
28985  ldra_port_write (&ldra_buffer[0]);
28986  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
28987  ldra_port_write (&ldra_buffer[0]);
28988  last += 8;
28989  branches_printed += 8;
28990  if (branches_printed >= qqqbranches)
28991  {
28992  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
28993  break;
28994  }
28995  }
28996  }
28997  /* ----------------------------------------------------------------------* 336 *
28998  * qqqupload
28999  * This routine loops through the stored bitmap and
29000  * outputs it. It then uploads the stored mcdc.
29001  * -----------------------------------------------------------------------------
29002  */
29003  static void qqqupload(qqnull_params)
29004  {
29005  int i;
29006  /* uncompressed bitmap (!singlefile or mainfl) separate */
29007  {
29008  statusst_58zqqzqz1();
29009 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
29010 #define LASTELEMENT
29011 #include "statusst_58zbelem.def"
29012 #undef LASTELEMENT
29013 #undef ELEMENT
29014  }
29015  /* bitmap separate */
29016  qqqlast = 1; /* stops qqfun() calling initialise again */
29017  } /* end of qqqupload */
29018  /* ----------- zqzqzq ---------------------------------------------------* 342 *
29019  * -----------------------------------------------------------------------------
29020  */
29021  /* ----------------------------------------------------------------------* 344 *
29022  * This routine should be called before the program
29023  * terminates. It closes the execution history
29024  * -----------------------------------------------------------------------------
29025  */
29026  static int statusst_58zqzqzq(int qqqi)
29027  {
29028  if ( statusst_58zzopen != 1 )
29029  {
29030  statusst_58zqqzqz1();
29031  }
29032  /* not compressed */
29033  /* do nothing for bitmap*/
29034  /* upload the history */
29035  /* bitmap */
29036  /* uncompressed bitmap */
29037  statusst_58zqendz(qqqi);
29038  /* qqqupload closes the execution history file */
29039  return(1);
29040  } /* end of zqzqzq */
29041  /* the following routines should be left alone */
29042 /* END OF TESTBED INSTRUMENTATION */
29043 
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
unsigned char uchar8_t
SYS_DMA_CRC_WRITE_ORDER
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
SYS_DMA_TRANSFER_EVENT
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
static int statusst_58zqendz(int qqqi)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void DRV_IC0_Start(void)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
bool SYS_DMA_IsBusy(void)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
static void Send_Space(void)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_SPI_Close(DRV_HANDLE handle)
TFifo RX_FIFO
Definition: fifo.c:47
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
void Clear_Status(uint8_t bitposn)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
DRV_USART_OPERATION_MODE
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
#define qqqbranches
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
struct _DRV_SPI_INIT DRV_SPI_INIT
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
uint32_t DRV_TMR0_PeriodValueGet(void)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
uint8_t Fifo_Length(TFifo *ptrFifo)
Definition: fifo.c:202
void DRV_TMR0_CounterValueSet(uint32_t value)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void DRV_TMR3_CounterValueSet(uint32_t value)
SYS_DMA_CHANNEL_OP_MODE
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
float float32_t
Definition: cf.h:50
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
DRV_USART_INIT_FLAGS
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
DRV_SPI_BUFFER_EVENT
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
DRV_SPI_CLOCK_MODE
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
SYS_DMA_SIDL
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void DRV_TMR0_StopInIdleDisable(void)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART0_WriteByte(const uint8_t byte)
void Generate_Sine_Wave_Data(float32_t NoOfTicks)
Definition: fsk.c:501
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
static struct bitmapstruct_t bitmapstruct
void DRV_TMR0_StopInIdleEnable(void)
void DRV_TMR1_PeriodValueSet(uint32_t value)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
void DRV_TMR0_CounterClear(void)
void DRV_IC_Stop(DRV_HANDLE handle)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
void DRV_TMR4_StopInIdleDisable(void)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
static void DRV_TMR4_Tasks(void)
void SYS_DMA_Suspend(void)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
SYS_DMA_ERROR
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
SYS_DMA_DATA_WIDTH
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
bool DRV_SPIn_ReceiverBufferIsFull(void)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
SYS_ERROR_LEVEL gblErrLvl
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_SPI_BUFFER_TYPE
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
Definition: fifo.h:59
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void qqoutput(FILEPOINT char *s, int i)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
static void DRV_TMR4_Open(void)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR2_StopInIdleDisable(void)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void DRV_ADC_DeInitialize(void)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
TFifo TX_FIFO
Definition: fifo.c:48
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
static void qqoutput0(FILEPOINT char *s)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static int qqqisinitialised
Definition: inszt_main.c:152
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
APP_DATA APP
Definition: app.c:73
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_CLIENT_STATUS
static void Fifo_Init(TFifo *ptrFifo, uint8_t *ptrBuffer, uint16_t Length)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void Send_Message_Tasks(void)
uint32_t DRV_TMR3_CounterValueGet(void)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
void DRV_TMR4_CounterValueSet(uint32_t value)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
static void DRV_TMR0_Close(void)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_OPERATION_MODE
uintptr_t SYS_DMA_CHANNEL_HANDLE
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
#define qqnull_params
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
static void DRV_TMR3_Close(void)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void Reset_CRC_Value(void)
Definition: crc.c:141
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
int qqupload_registered
Definition: inszt_main.c:6760
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_TMR3_Initialize(void)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t Fifo_Put(TFifo *ptrFifo, uint8_t Data)
Definition: fifo.c:117
void DRV_USART0_Close(void)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool DRV_IC0_BufferIsEmpty(void)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
Definition: fsk.h:123
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR1_Status(void)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
uint8_t Calc_CRC_Uplink(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:116
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void DRV_TMR2_Stop(void)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
static void DRV_TMR0_DeInitialize(void)
uint32_t DRV_TMR4_PeriodValueGet(void)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
#define statusst_58zqqzqz1
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
static void DRV_TMR3_Open(void)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
static void Init_FSK(void)
bool DRV_TMR0_Start(void)
static uint16_t PIB_Status
void DRV_PMP0_Write(uint8_t data)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
static void DRV_TMR2_Close(void)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static void qqqqinitialise(int ii)
uint32_t baudRate
Definition: inszt_adc.c:26572
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void PLIB_USART_Enable(USART_MODULE_ID index)
void DRV_TMR2_Initialize(void)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
PORTS_PIN_INTERRUPT_TYPE
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
static int qqqstructzzopen
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
void DRV_TMR4_Initialize(void)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
TMultiValue MESSAGE
Definition: fsk.c:70
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
#define FILEPOINT
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void APP_Initialize(void)
Definition: app.c:93
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
void DRV_TMR0_PeriodValueSet(uint32_t value)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
static unsigned char qqqzzglobflag
static void DRV_TMR2_DeInitialize(void)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void DRV_TMR3_PeriodValueSet(uint32_t value)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
uint16_t DRV_IC0_Capture16BitDataRead(void)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
static int zzfileid
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_CHAIN_PRIO
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
PREAMBLE_STATES
void DRV_TMR4_Stop(void)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
static int statusst_58zqzqzq(int qqqi)
DRV_IO_INTENT
Definition: inszt_adc.c:975
uint32_t DRV_TMR2_CounterValueGet(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
DRV_SPI_PROTOCOL_TYPE
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
uint8_t Get_CRC_Value(void)
Definition: crc.c:157
void DRV_PMP0_Initialize(void)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR1_StopInIdleEnable(void)
void FSK_Tasks(void)
Definition: fsk.c:104
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
Definition: fsk.h:170
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
void DRV_PMP0_ModeConfig(void)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
bool DRV_SPIn_TransmitterBufferIsFull(void)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
uint32_t DRV_TMR1_CounterValueGet(void)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
DRV_SPI_TASK_MODE
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
static const uint8_t Xmit11[312]
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
static void DRV_TMR1_Tasks(void)
SYS_DMA_CHANNEL_IGNORE_MATCH
void DRV_TMR3_Stop(void)
Definition: fsk.h:217
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
PRE_DATA PRE_MSG
Definition: fsk.c:73
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
static SYS_STATUS DRV_TMR2_Status(void)
uint8_t DRV_USART0_ReadByte(void)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
bool DRV_TMR3_Start(void)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
bool DRV_USART0_TransmitBufferIsFull(void)
uintptr_t DRV_USART_BUFFER_HANDLE
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
static const uint8_t Xmit00[168]
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
Definition: fsk.h:78
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
void DRV_TMR2_CounterValueSet(uint32_t value)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void DRV_ADC0_Open(void)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
SYSTEM_OBJECTS sysObj
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
#define statusst_58zzopen
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
static char qqqqone[]
static int qqqqbmselwidth
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
DRV_SPI_MODE
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void DRV_ADC_Initialize(void)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
SYS_STATUS DRV_USART0_Status(void)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_DeInitialize(void)
void DRV_IC0_Stop(void)
void DRV_TMR2_PeriodValueSet(uint32_t value)
void DRV_TMR0_Initialize(void)
DRV_IO_BUFFER_TYPES
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
SYS_PORTS_PIN_DIRECTION
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void DRV_TMR3_StopInIdleDisable(void)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
uintptr_t DRV_HANDLE
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
DRV_USART_TRANSFER_STATUS
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void DRV_TMR3_CounterClear(void)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_USART_BUFFER_EVENT
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PORTS_DATA_MASK
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
uint8_t Fifo_Get(TFifo *ptrFifo)
Definition: fifo.c:160
bool DRV_TMR_Start(DRV_HANDLE handle)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
static SYS_STATUS DRV_TMR3_Status(void)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
void DRV_TMR2_CounterClear(void)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
void DRV_USART0_Deinitialize(void)
void DRV_USART0_TasksTransmit(void)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
void SYS_PORTS_Initialize()
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
uint8_t queueSize
Definition: inszt_adc.c:26592
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void DRV_ADC1_Open(void)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
int qqqshell_upload
Definition: inszt_main.c:150
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
DRV_USART_BUFFER_RESULT
void PLIB_USART_Disable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
static void qqqbitmapreset(qqnull_params)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
#define QQQnumfil
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_Close(const DRV_HANDLE handle)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void(* ldra_void_function)()
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
void Prepare_Dwn_Msg(uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length)
Definition: fsk.c:227
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
static int statusst_58zscanf(char *qqscan_str)
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void DRV_TMR2_StopInIdleEnable(void)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
DRV_IO_INTENT
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
uint32_t DRV_TMR2_PeriodValueGet(void)
void SYS_DEBUG_Print(const char *format,...)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
static void DRV_TMR4_Close(void)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
float float32_t
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
void DRV_TMR1_CounterClear(void)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_USART_LINE_CONTROL
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
FSK_STATES
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
static void DRV_TMR0_Tasks(void)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
int QQQindicator
Definition: inszt_main.c:104
void DRV_TMR4_CounterClear(void)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
static void Send_Mark(void)
uint32_t DRV_TMR1_PeriodValueGet(void)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_IC0_Initialize(void)
SYS_DMA_CHANNEL_CRC_MODE
void DRV_TMR3_StopInIdleEnable(void)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
bool DRV_TMR2_Start(void)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
static void DRV_TMR3_Tasks(void)
MSG_STATES
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PREAMBLE_STATES
Definition: fsk.h:191
void DRV_TMR4_PeriodValueSet(uint32_t value)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
static void DRV_TMR1_DeInitialize(void)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void DRV_ADC_Start(void)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
DRV_USART_HANDSHAKE
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:92
DOWN_MSG DWNMSG
Definition: fsk.c:69
static void DRV_TMR0_Open(void)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void SYS_DMA_Resume(void)
static void DRV_TMR2_Tasks(void)
void Init_Fifo(void)
Definition: fifo.c:100
static void DRV_TMR1_Close(void)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
bool DRV_TMR4_Start(void)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uintptr_t DRV_SPI_BUFFER_HANDLE
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
void Set_Status(uint8_t bitposn)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
uint32_t DRV_TMR4_CounterValueGet(void)
DRV_USART_ERROR
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DRV_CLIENT_STATUS
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
static void qqoutput2(FILEPOINT char *s, int i, int j)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
void Prepare_Return_B(uint8_t byt [])
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
#define DRV_IC_Close(handle)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
static int statusst_58zqqzqz(qqnull_params)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
SYS_ERROR_LEVEL
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void Calc_CRC(uint16_t nbits, uint8_t thebits)
Definition: crc.c:55
uint32_t DRV_TMR0_CounterValueGet(void)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
Definition: app.h:59
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
void APP_Tasks(void)
Definition: app.c:130
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_TMR_CLK_SOURCES
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
static void qqqupload(qqnull_params)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
DRV_USART_LINE_CONTROL_SET_RESULT
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
MSG_STATES
Definition: fsk.h:145
#define DRV_IC_Open(drvIndex, intent)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void DRV_TMR1_StopInIdleDisable(void)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC1_Close(void)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
static int qqqlast
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
void SYS_DEBUG_Message(const char *message)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
DRV_ADC_MODULE_ID
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
static void DRV_TMR2_Open(void)
void DRV_TMR0_Stop(void)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
static int tbrun_mode
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
FSK_DATA FSK
Definition: fsk.c:71
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
FSK_STATES
Definition: fsk.h:53
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
uint8_t command
Definition: fsk.h:126
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void DRV_TMR4_StopInIdleEnable(void)
uint8_t DRV_PMP0_Read(void)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR_Stop(DRV_HANDLE handle)
bool DRV_TMR1_Start(void)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
void DRV_TMR1_Initialize(void)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
uint32_t DRV_IC0_Capture32BitDataRead(void)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
void DRV_TMR_Close(DRV_HANDLE handle)
void DRV_USART0_TasksError(void)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
void DRV_TMR1_Stop(void)
static SYS_STATUS DRV_TMR0_Status(void)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void DRV_ADC_Stop(void)
void DRV_ADC0_Close(void)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
void DRV_TMR1_CounterValueSet(uint32_t value)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR4_DeInitialize(void)
static int QQQfirstmcdc
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
static SYS_STATUS DRV_TMR4_Status(void)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
uint32_t PORTS_DATA_TYPE
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
static void DRV_TMR1_Open(void)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
MSG_DATA MSG
Definition: fsk.c:72
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)